!(function (e, t) {
	if ("object" == typeof exports && "object" == typeof module) module.exports = t()
	else if ("function" == typeof define && define.amd) define([], t)
	else {
		var o = t()
		for (var n in o) ("object" == typeof exports ? exports : e)[n] = o[n]
	}
})(this, function () {
	return (() => {
		"use strict"
		var e = {
				331: function (e, t) {
					var o,
						n,
						r =
							(this && this.__assign) ||
							function () {
								return (r =
									Object.assign ||
									function (e) {
										for (var t, o = 1, n = arguments.length; o < n; o++)
											for (var r in (t = arguments[o])) Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r])
										return e
									}).apply(this, arguments)
							}
					Object.defineProperty(t, "__esModule", { value: !0 }),
						(t.Request = t.RequestQueue = t.RequestStatus = t.RequestPriority = void 0),
						(function (e) {
							;(e[(e.LOW = 0)] = "LOW"),
								(e[(e.MEDIUM = 1)] = "MEDIUM"),
								(e[(e.HIGH = 2)] = "HIGH"),
								(e[(e.HIGHEST = 3)] = "HIGHEST")
						})((o = t.RequestPriority || (t.RequestPriority = {}))),
						(function (e) {
							;(e[(e.PENDING = 0)] = "PENDING"),
								(e[(e.SENDING = 1)] = "SENDING"),
								(e[(e.FAILED = 2)] = "FAILED"),
								(e[(e.DONE = 3)] = "DONE")
						})((n = t.RequestStatus || (t.RequestStatus = {})))
					var a = (function () {
						function e(e) {
							var t = void 0 === e ? {} : e,
								o = t.retries,
								n = void 0 === o ? 0 : o,
								r = t.concurrency,
								a = void 0 === r ? 6 : r
							;(this.totalBytesDownloaded = 0), (this.queue = []), (this.retries = n), (this.concurrency = a)
						}
						return (
							(e.prototype.get = function (e, t) {
								return this.request("GET", e, t)
							}),
							(e.prototype.head = function (e, t) {
								return this.request("HEAD", e, t)
							}),
							(e.prototype.options = function (e, t) {
								return this.request("OPTIONS", e, t)
							}),
							(e.prototype.post = function (e, t) {
								return this.request("POST", e, t)
							}),
							(e.prototype.put = function (e, t) {
								return this.request("PUT", e, t)
							}),
							(e.prototype.patch = function (e, t) {
								return this.request("PATCH", e, t)
							}),
							(e.prototype.delete = function (e, t) {
								return this.request("DELETE", e, t)
							}),
							(e.prototype.request = function (e, t, o) {
								var n = new s(e, t, o)
								return this.enqueue(n), n.promise
							}),
							(e.prototype.update = function () {
								for (var e; (e = this.getNextPendingRequest()); ) this.sendRequest(e)
								for (; (e = this.getNextOverflowingGet()); ) e.abort(), (e.status = n.PENDING)
								this.updateTimeout = null
							}),
							(e.prototype.enqueue = function (e) {
								var t = this,
									o = 0
								for (o = 0; o < this.queue.length; o++) {
									if (this.queue[o].priority < e.priority) break
								}
								this.queue.splice(o, 0, e),
									this.updateTimeout ||
										(this.updateTimeout = window.setTimeout(function () {
											t.update()
										}, 1))
							}),
							(e.prototype.dequeue = function (e) {
								var t = this.queue.indexOf(e)
								if (-1 === t) throw new Error("Can't dequeue request not in queue")
								this.queue.splice(t, 1), this.update()
							}),
							(e.prototype.getNextPendingRequest = function () {
								for (var e = 0; e < this.queue.length && e < this.concurrency; e++) {
									var t = this.queue[e]
									if (t.status === n.PENDING) return t
								}
								return null
							}),
							(e.prototype.getNextOverflowingGet = function () {
								for (var e = this.concurrency; e < this.queue.length; e++) {
									var t = this.queue[e]
									if (t.status === n.SENDING && t.priority !== o.HIGHEST && "GET" === t.method) return t
								}
								return null
							}),
							(e.prototype.shouldRetryStatusCode = function (t) {
								return !e.doNotRetryStatusCodes[t]
							}),
							(e.prototype.sendRequest = function (e) {
								var t = this
								;(e.status = n.SENDING),
									e
										.send()
										.then(function (o) {
											;(e.status = n.DONE),
												t.dequeue(e),
												e.contentLength && e.contentLength > 0 && (t.totalBytesDownloaded += Number(e.contentLength)),
												e.onDone(o)
										})
										.catch(function (o) {
											var r = null !== e.maxRetries ? e.maxRetries : t.retries,
												a = e.sendAttempts < r
											if ("object" == typeof o) {
												var s = o.status_code || 0
												a = a && t.shouldRetryStatusCode(s)
											}
											a
												? ((e.status = n.PENDING), t.update(), console.warn("Retried " + e.url), console.warn(o))
												: ((e.status = n.FAILED), t.dequeue(e), console.warn("Failed " + e.url), e.onFail(o))
										})
							}),
							(e.doNotRetryStatusCodes = {
								400: !0,
								401: !0,
								403: !0,
								404: !0,
								405: !0,
								406: !0,
								410: !0,
								411: !0,
								414: !0,
								415: !0,
								421: !0,
								431: !0,
								451: !0
							}),
							e
						)
					})()
					t.RequestQueue = a
					var s = (function () {
						function e(e, t, r) {
							var a = this
							void 0 === r && (r = {}),
								(this.sendAttempts = 0),
								(this.status = n.PENDING),
								(this.contentLength = 0),
								(this.url = t),
								(this.method = e),
								(this.auth = r.auth || null),
								(this.withCredentials = r.withCredentials || !1),
								(this.priority = r.priority || o.MEDIUM),
								(this.responseType = r.responseType || null),
								(this.body = r.body || null),
								(this.headers = r.headers || {}),
								(this.maxRetries = r.maxRetries || null),
								(this.onProgress = r.onProgress),
								(this.promise = new Promise(function (e, t) {
									;(a.onDone = e), (a.onFail = t)
								}))
						}
						return (
							(e.prototype.send = function () {
								var e = this,
									t = (this.xhr = (function (e, t, o) {
										var n
										if ("undefined" != typeof XMLHttpRequest) (n = new XMLHttpRequest()).withCredentials = o
										else {
											if ("undefined" == typeof XDomainRequest)
												throw new Error("No XMLHTTPRequest or XDomainRequest... are you trying to run me in node? :(")
											n = new XDomainRequest()
										}
										return n.open(e, t, !0), n
									})(this.method, this.url, this.withCredentials))
								if (this.responseType)
									if (
										"arraybuffer" === this.responseType ||
										"text" === this.responseType ||
										"json" === this.responseType ||
										"blob" === this.responseType
									)
										t.responseType = this.responseType
									else {
										if ("image" !== this.responseType)
											throw new Error('reponseType can only be one of "arraybuffer", "text", "json", "blob", "image"')
										t.responseType = "blob"
									}
								for (var o in ("json" === this.responseType && t.setRequestHeader("Accept", "application/json"),
								this.auth && "string" == typeof this.auth && t.setRequestHeader("Authorization", this.auth),
								this.headers))
									t.setRequestHeader(o, this.headers[o])
								return (
									this.body &&
										"object" == typeof this.body &&
										(this.body instanceof FormData ||
											((this.body = JSON.stringify(this.body)),
											t.setRequestHeader("Content-Type", "application/json"))),
									this.onProgress && (t.onprogress = this.onProgress),
									new Promise(function (o, n) {
										;(t.onreadystatechange = function (a) {
											if (4 === t.readyState) {
												if (200 === t.status || 201 === t.status || 204 === t.status)
													return e.parseResponse(e.xhr).then(function (e) {
														o(e)
													})
												if (0 !== t.status)
													return e
														.parseResponse(e.xhr)
														.then(function (e) {
															n(r({ status_code: t.status }, e))
														})
														.catch(function () {
															n({ status_code: t.status })
														})
											}
										}),
											(t.onerror = function (e) {
												n(e)
											}),
											t.send(e.body),
											e.sendAttempts++
									})
								)
							}),
							(e.prototype.parseResponse = function (e) {
								var t = this
								return new Promise(function (o, n) {
									try {
										var r = e.response
										if (
											((t.contentLength = e.getResponseHeader("Content-Length")),
											"json" === t.responseType && "object" != typeof r)
										)
											o(JSON.parse(e.responseText))
										else if ((200 !== e.status && 201 !== e.status && 204 !== e.status) || "image" !== t.responseType)
											o(r)
										else {
											var a = URL.createObjectURL(r)
											;((r = new Image()).src = a),
												(r.crossOrigin = "Anonymous"),
												(r.onload = function () {
													URL.revokeObjectURL(a), o(r)
												})
										}
									} catch (e) {
										n({ error: "Payload was not valid JSON" })
									}
								})
							}),
							(e.prototype.abort = function () {
								if (null === this.xhr) throw new Error("Cannot abort unsent Request")
								this.xhr.abort()
							}),
							e
						)
					})()
					t.Request = s
				}
			},
			t = {}
		function o(n) {
			var r = t[n]
			if (void 0 !== r) return r.exports
			var a = (t[n] = { exports: {} })
			return e[n].call(a.exports, a, a.exports, o), a.exports
		}
		;(o.d = (e, t) => {
			for (var n in t) o.o(t, n) && !o.o(e, n) && Object.defineProperty(e, n, { enumerable: !0, get: t[n] })
		}),
			(o.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)),
			(o.r = e => {
				"undefined" != typeof Symbol &&
					Symbol.toStringTag &&
					Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }),
					Object.defineProperty(e, "__esModule", { value: !0 })
			})
		var n = {}
		return (
			(() => {
				var e, t, r, a, s, i, d
				o.r(n),
					o.d(n, { IdOption: () => a, setup: () => Ge }),
					(function (e) {
						;(e.FORWARD = "FORWARD"),
							(e.LEFT = "LEFT"),
							(e.RIGHT = "RIGHT"),
							(e.BACK = "BACK"),
							(e.UP = "UP"),
							(e.DOWN = "DOWN")
					})(e || (e = {}))
				class DirectionConverter {
					constructor(t) {
						this.directionMap = {
							[e.FORWARD]: t.FORWARD.clone(),
							[e.LEFT]: t.LEFT.clone(),
							[e.RIGHT]: t.RIGHT.clone(),
							[e.BACK]: t.BACK.clone(),
							[e.UP]: t.UP.clone(),
							[e.DOWN]: t.DOWN.clone()
						}
					}
					toVector(e) {
						return this.directionMap[e]
					}
				}
				!(function (e) {
					;(e.INSIDE = "mode.inside"),
						(e.OUTSIDE = "mode.outside"),
						(e.DOLLHOUSE = "mode.dollhouse"),
						(e.FLOORPLAN = "mode.floorplan"),
						(e.TRANSITIONING = "mode.transitioning")
				})(t || (t = {}))
				class ViewmodeConverter {
					constructor(e) {
						this.CwfViewmode = e
					}
					toSdk(e, o) {
						switch (e) {
							case this.CwfViewmode.Panorama:
								return o ? t.INSIDE : t.OUTSIDE
							case this.CwfViewmode.Dollhouse:
								return t.DOLLHOUSE
							case this.CwfViewmode.Floorplan:
								return t.FLOORPLAN
							case this.CwfViewmode.Transition:
								return t.TRANSITIONING
							case this.CwfViewmode.Outdoor:
								return t.OUTSIDE
							default:
								return t.INSIDE
						}
					}
					fromSdk(e) {
						switch (e) {
							case t.INSIDE:
							case t.OUTSIDE:
								return this.CwfViewmode.Panorama
							case t.DOLLHOUSE:
								return this.CwfViewmode.Dollhouse
							case t.FLOORPLAN:
								return this.CwfViewmode.Floorplan
							case t.TRANSITIONING:
								return this.CwfViewmode.Transition
						}
					}
				}
				class CommandModeConverter {
					constructor(e) {
						this.CommandMode = e
					}
					toSdk(e, o) {
						switch (e) {
							case this.CommandMode.INSIDE:
								return o ? t.INSIDE : t.OUTSIDE
							case this.CommandMode.DOLLHOUSE:
								return t.DOLLHOUSE
							case this.CommandMode.FLOORPLAN:
								return t.FLOORPLAN
							case this.CommandMode.TRANSITIONING:
								return t.TRANSITIONING
							case this.CommandMode.OUTSIDE:
								return t.OUTSIDE
							default:
								return t.INSIDE
						}
					}
					fromSdk(e) {
						switch (e) {
							case t.INSIDE:
								return this.CommandMode.INSIDE
							case t.OUTSIDE:
								return this.CommandMode.OUTSIDE
							case t.DOLLHOUSE:
								return this.CommandMode.DOLLHOUSE
							case t.FLOORPLAN:
								return this.CommandMode.FLOORPLAN
							case t.TRANSITIONING:
								return this.CommandMode.TRANSITIONING
						}
					}
				}
				!(function (e) {
					;(e.INSTANT = "transition.instant"),
						(e.FLY = "transition.fly"),
						(e.FADEOUT = "transition.fade"),
						(e.MOVEFADE = "transition.movefade")
				})(r || (r = {}))
				class CameraTransitionConverter {
					constructor(e) {
						;(this.toSdkTransitionMap = {
							[e.Interpolate]: r.FLY,
							[e.FadeToBlack]: r.FADEOUT,
							[e.Instant]: r.INSTANT,
							[e.MoveToBlack]: r.MOVEFADE
						}),
							(this.fromSdkTransitionMap = {
								[r.FLY]: e.Interpolate,
								[r.FADEOUT]: e.FadeToBlack,
								[r.INSTANT]: e.Instant,
								[r.MOVEFADE]: e.MoveToBlack
							})
					}
					toSdkTransition(e) {
						return this.toSdkTransitionMap[e]
					}
					fromSdkTransition(e) {
						return this.fromSdkTransitionMap[e]
					}
				}
				class Conversion {
					constructor(e) {
						;(this.THREE = e), (this.tempEuler = new e.Euler())
					}
					quaternionToRotation(e, t) {
						const o = this.tempEuler.setFromQuaternion(e, Conversion.eulerOrder),
							n = t || {}
						return (
							(n.x = this.THREE.MathUtils.radToDeg(o.x)),
							(n.y = this.THREE.MathUtils.radToDeg(o.y)),
							(n.z = this.THREE.MathUtils.radToDeg(o.z)),
							n
						)
					}
					rotationToQuaternion(e, t) {
						const o = t || new this.THREE.Quaternion()
						return (
							(this.tempEuler.x = this.THREE.MathUtils.degToRad(e.x)),
							(this.tempEuler.y = this.THREE.MathUtils.degToRad(e.y)),
							(this.tempEuler.z = this.THREE.MathUtils.degToRad(e.z || 0)),
							(this.tempEuler.order = Conversion.eulerOrder),
							o.setFromEuler(this.tempEuler)
						)
					}
				}
				Conversion.eulerOrder = "YXZ"
				class SweepUtils {
					constructor(e) {
						this.CwfSweepAlignmentType = e
					}
					isSweepAligned(e, t) {
						if (!e || !t) return !1
						const o = t && e.getSweep(t)
						return !!o && o.alignmentType === this.CwfSweepAlignmentType.ALIGNED
					}
					isCurrentSweepAligned(e) {
						return this.isSweepAligned(e, e.currentSweep)
					}
				}
				!(function (e) {
					;(e.LEGACY = "legacy"), (e.API = "api")
				})(a || (a = {}))
				class LegacySweepIdMap {
					constructor(e) {
						this.sweepData = e
					}
					getIdForSweep(e) {
						return e.uuid
					}
					getSweepForId(e) {
						return this.sweepData.getSweepByUuid(e)
					}
					getIdFromCwfId(e) {
						const t = this.sweepData.getSweep(e)
						return this.getIdForSweep(t)
					}
				}
				class SweepIdMap {
					constructor(e) {
						this.sweepData = e
					}
					getIdForSweep(e) {
						return e.id
					}
					getSweepForId(e) {
						return this.sweepData.getSweep(e)
					}
					getIdFromCwfId(e) {
						const t = this.sweepData.getSweep(e)
						return this.getIdForSweep(t)
					}
				}
				class LegacyFloorIdMap {
					constructor(e) {
						this.floorData = e
					}
					getIdForFloor(e) {
						return String(e.index)
					}
					getFloorForId(e) {
						return this.floorData.getFloorAtIndex(parseInt(e, 10))
					}
					getIdFromCwfId(e) {
						const t = this.floorData.getFloor(e)
						return this.getIdForFloor(t)
					}
				}
				class FloorIdMap {
					constructor(e) {
						this.floorData = e
					}
					getIdForFloor(e) {
						return e.id
					}
					getFloorForId(e) {
						return this.floorData.getFloor(e)
					}
					getIdFromCwfId(e) {
						const t = this.floorData.getFloor(e)
						return this.getIdForFloor(t)
					}
				}
				class RoomValueMap {
					constructor() {
						this.values = new Map()
					}
					get(e, t) {
						const o = RoomValueMap.keyFromGroupValues(e, t)
						return this.values.get(o)
					}
					set(e, t, o) {
						const n = RoomValueMap.keyFromGroupValues(e, t)
						this.values.set(n, o)
					}
					[Symbol.iterator]() {
						let e = 0
						const t = Array.from(this.values.entries())
						return {
							next() {
								if (e < t.length) {
									const o = t[e++],
										{ meshGroup: n, meshSubgroup: r } = RoomValueMap.groupValuesFromKey(o[0])
									return { done: !1, value: { meshGroup: n, meshSubgroup: r, value: o[1] } }
								}
								return { done: !0, value: null }
							}
						}
					}
					static keyFromGroupValues(e, t) {
						return (e << 16) + t
					}
					static groupValuesFromKey(e) {
						return { meshGroup: e >> 16, meshSubgroup: 65535 & e }
					}
				}
				class LegacyRoomIdMap {
					constructor(e) {
						this.roomData = e
					}
					getIdForRoom(e) {
						return String(RoomValueMap.keyFromGroupValues(e.meshGroup, e.meshSubgroup))
					}
					getRoomForId(e) {
						const { meshGroup: t, meshSubgroup: o } = RoomValueMap.groupValuesFromKey(parseInt(e, 10))
						return this.roomData.getByMeshSubgroup(t, o)
					}
					getIdFromCwfId(e) {
						const t = this.roomData.get(e)
						return this.getIdForRoom(t)
					}
				}
				class RoomIdMap {
					constructor(e) {
						this.roomData = e
					}
					getIdForRoom(e) {
						return e.id
					}
					getRoomForId(e) {
						return this.roomData.get(e)
					}
					getIdFromCwfId(e) {
						const t = this.roomData.get(e)
						return this.getIdForRoom(t)
					}
				}
				!(function (e) {
					;(e.PHASE_CHANGE = "application.phasechange"), (e.APP_CHANGE = "application.appchange")
				})(s || (s = {})),
					(function (e) {
						;(e.UNKNOWN = "application.unknown"),
							(e.WEBVR = "application.webvr"),
							(e.SHOWCASE = "application.showcase"),
							(e.WORKSHOP = "application.workshop")
					})(i || (i = {})),
					(function (e) {
						;(e.UNINITIALIZED = "appphase.uninitialized"),
							(e.WAITING = "appphase.waiting"),
							(e.LOADING = "appphase.loading"),
							(e.STARTING = "appphase.starting"),
							(e.PLAYING = "appphase.playing"),
							(e.ERROR = "appphase.error")
					})(d || (d = {}))
				class AppPhaseConverter {
					constructor(e) {
						;(this.toSdkPhaseMap = {
							[e.UNINITIALIZED]: d.UNINITIALIZED,
							[e.WAITING]: d.WAITING,
							[e.LOADING]: d.LOADING,
							[e.STARTING]: d.STARTING,
							[e.PLAYING]: d.PLAYING,
							[e.ERROR]: d.ERROR
						}),
							(this.fromSdkPhaseMap = {
								[d.UNINITIALIZED]: e.UNINITIALIZED,
								[d.WAITING]: e.WAITING,
								[d.LOADING]: e.LOADING,
								[d.STARTING]: e.STARTING,
								[d.PLAYING]: e.PLAYING,
								[d.ERROR]: e.ERROR
							})
					}
					toSdkAppPhase(e) {
						return this.toSdkPhaseMap[e]
					}
					fromSdkAppPhase(e) {
						return this.fromSdkPhaseMap[e]
					}
				}
				class ApplicationConverter {
					constructor(e) {
						;(this.toSdkApplicationMap = {
							[e.SHOWCASE]: i.SHOWCASE,
							[e.WORKSHOP]: i.WORKSHOP,
							[e.WEBVR]: i.WEBVR,
							[e.UNKNOWN]: i.UNKNOWN
						}),
							(this.fromSdkApplicationMap = {
								[i.SHOWCASE]: e.SHOWCASE,
								[i.WORKSHOP]: e.WORKSHOP,
								[i.WEBVR]: e.WEBVR,
								[i.UNKNOWN]: e.UNKNOWN
							})
					}
					toSdkApplication(e) {
						return this.toSdkApplicationMap[e]
					}
					fromSdkApplication(e) {
						return this.fromSdkApplicationMap[e]
					}
				}
				class SdkObservable {
					constructor(e, t, o) {
						;(this.dependencies = e),
							(this.subscriptionFactory = t),
							(this.observers = new Set()),
							(this.currentData = o.create()),
							(this.freshDataCache = o.create())
					}
					static async create(e, t, o) {
						const n = await e.getDependencies()
						return new SdkObservable(n, t, o)
					}
					getData() {
						return this.currentData.data
					}
					subscribe(e) {
						return (
							this.addObserver(e),
							new (class ObserverSubscription {
								constructor(e) {
									;(this.sdkObservable = e), this.renew()
								}
								renew() {
									this.sdkObservable.addObserver(e)
								}
								cancel() {
									this.sdkObservable.removeObserver(e)
								}
							})(this)
						)
					}
					addObserver(e) {
						if (!this.observers.has(e)) {
							class SdkObservableFacade {
								constructor(e) {
									this.observable = e
								}
								onChanged() {
									this.observable.onChanged()
								}
							}
							this.observers.add(e),
								1 === this.observers.size &&
									(this.currentData.update(...this.dependencies),
									(this.changeSubscription = this.subscriptionFactory.create(
										new SdkObservableFacade(this),
										...this.dependencies
									))),
								(e.dirty = !0)
						}
					}
					removeObserver(e) {
						0 !== this.observers.size &&
							(this.observers.delete(e), 0 === this.observers.size && this.changeSubscription.cancel())
					}
					onChanged() {
						if ((this.freshDataCache.update(...this.dependencies), !this.currentData.equals(this.freshDataCache))) {
							this.currentData.copy(this.freshDataCache)
							for (const e of this.observers) e.dirty = !0
						}
					}
				}
				class ClassFactory {
					constructor(e, ...t) {
						;(this.ctor = e), (this.args = t)
					}
					create() {
						return new this.ctor(...this.args)
					}
				}
				const c = e =>
						"propertyObservers" === e ||
						"changeObservers" === e ||
						"isObservable" === e ||
						"childChangeFunctions" === e ||
						"isObservableProxy" === e ||
						"diffRoot" === e ||
						"elementChangedHandlers" === e ||
						"knownKeysMap" === e ||
						"knownKeysList" === e ||
						"isVector2" === e ||
						"isVector3" === e ||
						"isQuaternion" === e ||
						"onPropertyChanged" === e ||
						"removeOnPropertyChanged" === e ||
						"onChanged" === e ||
						"target" === e,
					u = (e, t = []) => {
						if (void 0 !== e) {
							if (e in t) return {}
							if (e instanceof Date) return new Date(e)
							if (null === e) return null
							if (e.deepCopy) return e.deepCopy()
							if (e.isQuaternion) return { x: e.x, y: e.y, z: e.z, w: e.w }
							if ("object" == typeof e) {
								const o = Array.isArray(e) || ArrayBuffer.isView(e) ? [] : {}
								for (const n in e) {
									if (c(n)) continue
									const r = e[n]
									r instanceof Date
										? (o[n] = new Date(r))
										: "function" != typeof r && (o[n] = "object" == typeof r ? u(r, t.concat(e)) : r)
								}
								return o
							}
							return e
						}
					},
					p = (e, t) => {
						if (null === e || "object" != typeof e) return e !== t
						if (!t) return !0
						for (const o in t) if (!(o in e)) return !0
						for (const o in e) if (p(e[o], t[o])) return !0
						return !1
					}
				class AppStateSubFactory {
					create(e, t) {
						return t.onChanged(() => e.onChanged())
					}
				}
				class AppStateObservable {
					constructor(e, t) {
						;(this._data = { phase: d.UNINITIALIZED, phaseTimes: {}, application: i.SHOWCASE }),
							(this.AppPhase = e.AppPhase),
							(this.appPhaseConverter = t.appPhaseConverter),
							(this.applicationConverter = t.applicationConverter)
					}
					get data() {
						return this._data
					}
					equals(e) {
						return !p(this, e)
					}
					copy(e) {
						;(this._data.phase = e.data.phase),
							(function (e, t, ...o) {
								for (const n of o) e[n] = t[n]
							})(this.data.phaseTimes, e.data.phaseTimes),
							(this._data.application = e.data.application)
					}
					update(e) {
						;(this._data.phase = this.appPhaseConverter.toSdkAppPhase(e.phase)),
							(this._data.application = this.applicationConverter.toSdkApplication(e.application)),
							(this._data.phaseTimes[d.WAITING] = e.phaseTimes[this.AppPhase.WAITING]),
							(this._data.phaseTimes[d.LOADING] = e.phaseTimes[this.AppPhase.LOADING]),
							(this._data.phaseTimes[d.PLAYING] = e.phaseTimes[this.AppPhase.PLAYING]),
							(this._data.phaseTimes[d.STARTING] = e.phaseTimes[this.AppPhase.STARTING]),
							(this._data.phaseTimes[d.UNINITIALIZED] = e.phaseTimes[this.AppPhase.UNINITIALIZED]),
							(this._data.phaseTimes[d.ERROR] = e.phaseTimes[this.AppPhase.ERROR])
					}
				}
				class Command {}
				class GetAppStateCommand extends Command {
					constructor() {
						super(), (this.id = "GET_APP_STATE")
					}
				}
				class GetAppPhaseTimesCommand extends Command {
					constructor() {
						super(), (this.id = "GET_APP_PHASE_TIMES")
					}
				}
				class GetPoseCommand extends Command {
					constructor() {
						super(), (this.id = "GET_POSE")
					}
				}
				const m = (40 * Math.PI) / 180 / 1e3
				class LookAtScreenCoordsCommand extends Command {
					constructor(e) {
						super(), (this.payload = e)
					}
				}
				var l
				!(function (e) {
					e.MOVE = "camera.move"
				})(l || (l = {}))
				const h = window.navigationStart || Date.now()
				var g
				!(function (e) {
					;(e[(e.ERROR = 0)] = "ERROR"),
						(e[(e.WARN = 1)] = "WARN"),
						(e[(e.INFO = 2)] = "INFO"),
						(e[(e.DEBUG = 3)] = "DEBUG")
				})(g || (g = {}))
				class Logger {
					constructor(e) {
						;(this.timers = {}),
							(this.handlers = {
								[g.DEBUG]: console.debug,
								[g.INFO]: console.info,
								[g.WARN]: console.warn,
								[g.ERROR]: console.error
							})
						const t = e.split(new RegExp("/|\\\\"))
						this.prefix = "[" + t[t.length - 1].replace(".js", "") + "]"
					}
					message(e) {
						if (Logger.level >= e && console) {
							return (this.handlers[e] ? this.handlers[e] : console.log).bind(console, this.getPrefix())
						}
						return () => {}
					}
					get debug() {
						return this.message(g.DEBUG)
					}
					get debugWarn() {
						return this.message(Logger.level >= g.DEBUG ? g.WARN : g.DEBUG)
					}
					get info() {
						return this.message(g.INFO)
					}
					get warn() {
						return this.message(g.WARN)
					}
					get error() {
						return this.message(g.ERROR)
					}
					time(e) {
						Logger.level >= g.DEBUG && (this.timers[e] = Date.now())
					}
					timeEnd(e) {
						if (Logger.level >= g.DEBUG) {
							const t = this.timers[e]
							if (!t) return
							const o = (Date.now() - t) / 1e3
							this.debug(e, o + "s")
						}
					}
					getPrefix() {
						const e = (Date.now() - h) / 1e3 + "s"
						return `${this.prefix} ${e}`
					}
				}
				Logger.level = g.INFO
				const w = new Logger("broadcast.move")
				function f(e, t) {
					return Object.values(e).includes(t)
				}
				class MoveDirectionCommand extends Command {
					constructor(e) {
						super(), (this.id = "MOVE_DIRECTION"), (this.payload = e)
					}
				}
				class PanCommand extends Command {
					constructor(e) {
						super(), (this.id = "PAN"), (this.payload = { x: e.x, z: e.z })
					}
				}
				class AggregateSubscription {
					constructor(...e) {
						this.subs = e
					}
					renew() {
						for (const e of this.subs) e.renew()
					}
					cancel() {
						for (const e of this.subs) e.cancel()
					}
				}
				function C(e, t) {
					;(e.x = t.x), (e.y = t.y)
				}
				function y(e, t) {
					C(e, t), (e.z = t.z)
				}
				class BaseException_BaseException extends Error {
					constructor(e, t) {
						var o
						super(e instanceof Error ? e.message : e),
							(this.name = "BaseException"),
							t && (this.code = t),
							e instanceof Error &&
								((this.originalError = e), (o = e) && o instanceof Error && o.isMock && (this.isMock = !0))
					}
				}
				class ArraySizeMismatchException extends BaseException_BaseException {
					constructor() {
						super("Cannot copy into an array of a different size"), (this.name = "ArraySizeMismatch")
					}
				}
				const S = (e, t, o = 1e-5) => Math.abs(e - t) <= o,
					T = (e, t, o = 1e-5) => S(e.x, t.x, o) && S(e.y, t.y, o),
					I = (e, t, o = 1e-5) => T(e, t, o) && S(e.z, t.z, o)
				class PoseSubFactory {
					create(e, t, o, n) {
						const r = () => e.onChanged()
						return new AggregateSubscription(t.onChanged(r), o.onChanged(r), n.onChanged(r))
					}
				}
				class ObservablePose {
					constructor(e, o) {
						;(this._data = {
							position: { x: 0, y: 0, z: 0 },
							rotation: { x: 0, y: 0 },
							projection: new Float32Array(16),
							sweep: "",
							mode: t.TRANSITIONING
						}),
							(this.THREE = e),
							(this.viewmodeConverter = o),
							(this.tempEuler = new e.Euler())
					}
					get data() {
						return this._data
					}
					equals(e) {
						const t = 1e-5
						return (
							I(e._data.position, this._data.position, t) &&
							T(e._data.rotation, this._data.rotation, t) &&
							((e, t, o = 1e-5) => e.length === t.length && !Array.prototype.some.call(e, (e, n) => !S(e, t[n], o)))(
								e._data.projection,
								this._data.projection,
								t
							) &&
							e._data.sweep === this._data.sweep &&
							e._data.mode === this._data.mode
						)
					}
					update(e, t, o, n) {
						const r = this.tempEuler.setFromQuaternion(e.pose.rotation, "YXZ"),
							a = t.currentSweep && t.isSweepUnaligned(t.currentSweep)
						y(this._data.position, e.pose.position),
							(this._data.rotation.x = this.THREE.MathUtils.radToDeg(r.x)),
							(this._data.rotation.y = this.THREE.MathUtils.radToDeg(r.y)),
							(this._data.projection = Float32Array.from(e.pose.projection.asThreeMatrix4().transpose().elements)),
							(this._data.sweep = t.currentSweepObject ? n.getIdForSweep(t.currentSweepObject) : ""),
							(this._data.mode = this.viewmodeConverter.toSdk(o.currentMode, !a))
					}
					copy(e) {
						y(this._data.position, e.data.position),
							C(this._data.rotation, e.data.rotation),
							(function (e, t) {
								if (e.byteLength !== t.byteLength) throw new ArraySizeMismatchException()
								const o = t.length
								for (let n = 0; n < o; ++n) e[n] = t[n]
							})(this._data.projection, e.data.projection),
							(this._data.sweep = e.data.sweep),
							(this._data.mode = e.data.mode)
					}
				}
				class RotateCommand extends Command {
					constructor(e) {
						super(),
							(this.id = "ROTATE"),
							(this.payload = { xAngle: e.xAngle, yAngle: e.yAngle, zAngle: e.zAngle, rotationSpeed: e.rotationSpeed })
					}
				}
				function E(e, t, o) {
					const n = new e.Euler(),
						r = new e.Euler()
					return async function (e, a, s, i) {
						if (s.currentMode !== t.Panorama) throw Error("Camera.setRotation is only available in Panorama mode")
						const d = i.xAngle % (0.5 * Math.PI),
							c = i.yAngle % (2 * Math.PI),
							u = e.pose.rotation
						n.setFromQuaternion(u, "YXZ")
						let p = c - n.y
						return (
							Math.abs(p) > Math.PI && (p -= 2 * Math.sign(p) * Math.PI),
							r.set(d - n.x, p, 0, "YXZ"),
							(r.y %= 2 * Math.PI),
							o(a, { xAngle: -r.y, yAngle: r.x, zAngle: 0, rotationSpeed: i.rotationSpeed })
						)
					}
				}
				class SetOrientationCommand extends RotateCommand {}
				const v = 0.7,
					b = 3,
					D = new Logger("sdk command")
				class SdkCommand {
					constructor(e, t) {
						;(this.dependencies = e), (this.executor = t.create())
					}
					static async create(e, t) {
						const o = await e.getDependencies()
						return new SdkCommand(o, t)
					}
					exec(e, t) {
						const o = this.executor.validateInput(e, ...this.dependencies)
						this.executor.exec(o, t, ...this.dependencies)
					}
				}
				class DeprecatedDecorator {
					constructor(e, t) {
						;(this.deprecationWarning = t), (this.executor = e.create())
					}
					validateInput(e, ...t) {
						return D.warn(this.deprecationWarning), this.executor.validateInput(e, ...t)
					}
					exec(e, t, ...o) {
						this.executor.exec(e, t, ...o)
					}
				}
				const O = function (e, t, o) {
					return Math.max(t, Math.min(e, o))
				}
				function A(e, t, o) {
					return t <= e && e <= o
				}
				const N = new Logger("command.zoom")
				class ZoomToExecutor {
					constructor(e, t) {
						;(this.Viewmode = e.Viewmode),
							(this.ZoomSetCommand = e.ZoomSetCommand),
							(this.issueCommand = t.issueCommand)
					}
					validateInput(e) {
						const t = e.zoomPct - 0
						if (isNaN(t)) throw Error(t + " is not a valid zoom level")
						return (
							t < v &&
								b < t &&
								((e.zoomPct = O(t, v, b)), N.warn(t, `is outside the valid zoom range of [${v}, ${b}]`)),
							e
						)
					}
					async exec(e, t, o, n) {
						M(this.Viewmode, n.currentMode),
							await this.issueCommand(new this.ZoomSetCommand(e.zoomPct)),
							t.return(o.zoom())
					}
				}
				class ZoomByExecutor {
					constructor(e, t) {
						;(this.Viewmode = e.Viewmode), (this.ZoomInCommand = e.ZoomInCommand), (this.issueCommand = t.issueCommand)
					}
					validateInput(e) {
						const t = e.zoomDelta - 0
						if (isNaN(t)) throw Error(t + " is not a valid zoom delta")
						return (e.zoomDelta = t || 0), e
					}
					async exec(e, t, o, n) {
						M(this.Viewmode, n.currentMode),
							await this.issueCommand(new this.ZoomInCommand(e.zoomDelta)),
							t.return(o.zoom())
					}
				}
				class ZoomResetExecutor {
					constructor(e, t) {
						;(this.Viewmode = e.Viewmode),
							(this.ZoomResetCommand = e.ZoomResetCommand),
							(this.issueCommand = t.issueCommand)
					}
					validateInput(e) {
						return e
					}
					async exec(e, t, o, n) {
						M(this.Viewmode, n.currentMode), await this.issueCommand(new this.ZoomResetCommand()), t.return()
					}
				}
				function M(e, t) {
					if (t !== e.Panorama) throw Error("Zoom controls are currently only supported in Panorama mode")
				}
				class ZoomSubFactory {
					create(e, t) {
						return t.onChanged(() => e.onChanged())
					}
				}
				class ZoomObservableData {
					constructor(e) {
						this._data = { level: 1 }
					}
					get data() {
						return this._data
					}
					equals(e) {
						return this._data.level === e.data.level
					}
					copy(e) {
						this._data.level = e.data.level
					}
					update(e, t) {
						t.isInside() && (this._data.level = e.zoom())
					}
				}
				function x(e, t) {
					const o = new e.Euler()
					return function (n, r, a, s, i) {
						const d = o.setFromQuaternion(r.pose.rotation, "YXZ"),
							c = a.currentSweep && a.isSweepUnaligned(a.currentSweep)
						return (
							(n.position.x = r.pose.position.x),
							(n.position.y = r.pose.position.y),
							(n.position.z = r.pose.position.z),
							(n.rotation.x = e.MathUtils.radToDeg(d.x)),
							(n.rotation.y = e.MathUtils.radToDeg(d.y)),
							(n.projection = Float32Array.from(r.pose.projection.asThreeMatrix4().transpose().elements)),
							(n.sweep = a.currentSweepObject ? i.getIdForSweep(a.currentSweepObject) : ""),
							(n.mode = t.toSdk(s.currentMode, !c)),
							n
						)
					}
				}
				class FloorSubFactory {
					constructor() {
						;(this.wasInTransition = !1), (this.currentFloor = "")
					}
					create(e, t, o, n) {
						return new AggregateSubscription(
							t.makeFloorChangeSubscription(() => this.throttleCurrentFloorChanges(e, t)),
							n.onChanged(() => this.throttleCameraTranstionChanges(e, n, o)),
							o.onChanged(() => this.throttleCameraTranstionChanges(e, n, o))
						)
					}
					throttleCameraTranstionChanges(e, t, o) {
						const n = t.transition.active || o.transition.active
						n !== this.wasInTransition && ((this.wasInTransition = n), e.onChanged())
					}
					throttleCurrentFloorChanges(e, t) {
						const o = t.currentFloorId
						o !== this.currentFloor && ((this.currentFloor = o), e.onChanged())
					}
				}
				class CurrentFloorObservableData {
					constructor(e) {
						;(this._data = { id: void 0, sequence: void 0, name: "" }),
							(this.SweepAlignmentType = e.SweepAlignmentType),
							(this.SweepPlacementType = e.SweepPlacementType)
					}
					get data() {
						return this._data
					}
					equals(e) {
						const t = this.data,
							o = e.data
						return t.id === o.id && t.sequence === o.sequence && t.name === o.name
					}
					copy(e) {
						;(this._data.id = e.data.id), (this._data.sequence = e.data.sequence), (this._data.name = e.data.name)
					}
					update(e, t, o, n) {
						const r = e.currentFloor,
							a = t.currentSweep && t.getSweep(t.currentSweep)
						;(o.transition.active && !t.transitionActive) ||
						(function () {
							if (t.transitionActive && t.transition.to && t.transition.from) {
								const e = t.getSweep(t.transition.to),
									o = t.getSweep(t.transition.from)
								return e.floorId !== o.floorId
							}
							return !1
						})()
							? ((this._data.id = ""), (this._data.sequence = void 0), (this._data.name = ""))
							: a &&
							  a.alignmentType === this.SweepAlignmentType.UNALIGNED &&
							  a.placementType === this.SweepPlacementType.UNPLACED
							? ((this._data.id = void 0), (this._data.sequence = void 0), (this._data.name = ""))
							: r
							? ((this._data.id = n.getIdFromCwfId(r.id)), (this._data.sequence = r.index), (this._data.name = r.name))
							: ((this._data.id = ""), (this._data.sequence = -1), (this._data.name = "all"))
					}
				}
				var F
				!(function (e) {
					;(e.CHANGE_START = "floors.changestart"), (e.CHANGE_END = "floors.changeend")
				})(F || (F = {}))
				class SdkCollection {
					constructor(e, t, o) {
						;(this.dependencies = e),
							(this.subscriptionFactory = t),
							(this.observers = new Set()),
							(this.currentData = o.create()),
							(this.freshData = o.create())
					}
					static async create(e, t, o) {
						const n = await e.getDependencies()
						return new SdkCollection(n, t, o)
					}
					getData() {
						return this.currentData.data
					}
					observe(e) {
						return (
							this.addObserver(e),
							new (class ObserverSubscription {
								constructor(e) {
									;(this.sdkCollection = e), this.renew()
								}
								renew() {
									this.sdkCollection.addObserver(e)
								}
								cancel() {
									this.sdkCollection.removeObserver(e)
								}
							})(this)
						)
					}
					addObserver(e) {
						class CollectionChangeObserver {
							constructor(e) {
								this.sdkCollection = e
							}
							onChanged() {
								const { freshData: e, currentData: t, dependencies: o } = this.sdkCollection
								e.update(...o)
								let n = !1
								for (const o in e.data)
									if (t.data.hasOwnProperty(o)) {
										if (!t.isItemEqual(e, o))
											for (const t of this.sdkCollection.observers) t.onUpdated(o, e.data[o]), (n = !0)
									} else for (const t of this.sdkCollection.observers) t.onAdded(o, e.data[o]), (n = !0)
								for (const o in t.data)
									if (!e.data.hasOwnProperty(o)) for (const e of this.sdkCollection.observers) e.onRemoved(o), (n = !0)
								if (n) for (const e of this.sdkCollection.observers) e.onCollectionUpdated()
								const r = t
								;(this.sdkCollection.currentData = this.sdkCollection.freshData), (this.sdkCollection.freshData = r)
							}
						}
						if (!this.observers.has(e))
							if ((this.observers.add(e), 1 === this.observers.size)) {
								const e = new CollectionChangeObserver(this)
								;(this.changeSubscription = this.subscriptionFactory.create(e, ...this.dependencies)), e.onChanged()
							} else for (const t in this.currentData.data) e.onAdded(t, this.currentData.data[t])
					}
					removeObserver(e) {
						0 !== this.observers.size &&
							(this.observers.delete(e),
							0 === this.observers.size && (this.changeSubscription.cancel(), this.currentData.clear()))
					}
				}
				class collection_data_FloorSubFactory {
					create(e, t) {
						return t.onChanged(() => e.onChanged())
					}
				}
				class FloorDataCollection {
					constructor() {
						this._data = {}
					}
					get data() {
						return this._data
					}
					isItemEqual(e, t) {
						const o = this.data[t],
							n = e.data[t]
						return o.id === n.id && o.name === n.name && o.sequence === n.sequence
					}
					update(e, t) {
						for (const o of e.getCollection()) {
							const e = t.getIdFromCwfId(o.id),
								n = this._data[e] || {}
							;(n.id = e), (n.sequence = o.index), (n.name = o.name), (this._data[e] = n)
						}
						for (const e in this.data) {
							t.getFloorForId(e) || delete this._data[e]
						}
					}
					clear() {
						this._data = {}
					}
				}
				class GetFloorsDataCommand extends Command {
					constructor() {
						super(...arguments), (this.id = "GET_FLOORS_DATA")
					}
				}
				async function R(e) {
					try {
						const { currentFloor: t, totalFloors: o } = e,
							n = e.getFloorNames()
						return { currentFloor: t ? t.index : -1, floorNames: n, totalFloors: o }
					} catch (e) {
						throw Error("no floors currently loaded")
					}
				}
				class ChangeFloorCommand extends Command {
					constructor(e) {
						super(), (this.id = "MOVE_TO_FLOOR"), (this.payload = e)
					}
				}
				class ShowAllFloorsExecutor {
					constructor(e, t) {
						;(this.issueCommand = t.issueCommand), (this.ShowAllFloorsCommand = e.ShowAllFloorsCommand)
					}
					validateInput(e) {
						return e
					}
					async exec(e, t, o) {
						try {
							await this.issueCommand(new this.ShowAllFloorsCommand({ moveCamera: !0 }))
							const e = o.currentFloor
							t.return(e ? e.index : -1)
						} catch (e) {
							t.throw("Could not show all floors")
						}
					}
				}
				class LabelGetCommand extends Command {
					constructor() {
						super(...arguments), (this.id = "LABEL_GET")
					}
				}
				var P, _, L, k, G
				function V(e, t) {
					return function (o, n, r, a) {
						const s = r.getCollection(),
							i = [],
							d = new e.Vector2()
						for (const r of s) {
							t(o, r.position, d)
							const { id: s, index: c } = n.getFloor(r.floorId),
								p = a.getIdFromCwfId(s),
								m = u(r)
							i.push(
								Object.assign(Object.assign({}, m), {
									position: new e.Vector3().copy(r.position),
									screenPosition: d,
									floor: c,
									floorInfo: { id: p, sequence: c }
								})
							)
						}
						return i
					}
				}
				!(function (e) {
					e.POSITION_UPDATED = "label.positionupdated"
				})(P || (P = {})),
					(function (e) {
						;(e.HOVER = "tag.hover"), (e.CLICK = "tag.click"), (e.LINK_OPEN = "tag.linkopen")
					})(_ || (_ = {})),
					(function (e) {
						;(e.NONE = "mattertag.media.none"),
							(e.PHOTO = "mattertag.media.photo"),
							(e.VIDEO = "mattertag.media.video"),
							(e.RICH = "mattertag.media.rich")
					})(L || (L = {})),
					(function (e) {
						;(e.NONE = "tag.chunk.none"), (e.TEXT = "tag.chunk.text"), (e.LINK = "tag.chunk.link")
					})(k || (k = {})),
					(function (e) {
						;(e.NAVIGATION = "tag.link.nav"), (e.MODEL = "tag.link.model"), (e.EXT_LINK = "tag.link.ext")
					})(G || (G = {}))
				class MediaConverter {
					constructor(e, t) {
						;(this.toSdkMediaMap = { [e.PHOTO]: L.PHOTO, [e.VIDEO]: L.VIDEO, [e.RICH]: L.RICH }),
							(this.toSdkMediaFromChunk = {
								[t.error]: L.NONE,
								[t.link]: L.NONE,
								[t.none]: L.NONE,
								[t.photo]: L.PHOTO,
								[t.rich]: L.RICH,
								[t.text]: L.NONE,
								[t.video]: L.VIDEO
							})
					}
					toSdkMedia(e) {
						return this.toSdkMediaMap[e]
					}
					fromTagChunkType(e) {
						return this.toSdkMediaFromChunk[e]
					}
				}
				class ChunkTypeConverter {
					constructor(e) {
						this.toSdkChunkTypeMap = {
							[e.error]: k.NONE,
							[e.link]: k.LINK,
							[e.none]: k.NONE,
							[e.photo]: k.NONE,
							[e.rich]: k.NONE,
							[e.text]: k.TEXT,
							[e.video]: k.NONE
						}
					}
					toSdkChunkType(e) {
						return this.toSdkChunkTypeMap[e]
					}
				}
				class LinkTypeConverter {
					constructor(e) {
						this.toSdkLinkTypeMap = { [e.NAVIGATION]: G.NAVIGATION, [e.MODEL]: G.MODEL, [e.EXT_LINK]: G.EXT_LINK }
					}
					toSdkLinkType(e) {
						return this.toSdkLinkTypeMap[e]
					}
				}
				function U(e) {
					return "string" == typeof e
				}
				class TagIdInputException extends BaseException_BaseException {
					constructor(e) {
						super("Expected tagId parameter to be of type string; got " + (Array.isArray(e) ? "Array" : typeof e))
					}
				}
				var z = o(331)
				const B = new Logger("sdk.editIcon")
				class RegisterIconCommand extends Command {
					constructor(e) {
						super(), (this.payload = e), (this.id = "REGISTER_MATTERTAG_ICON")
					}
				}
				class EditIconCommand extends Command {
					constructor(e) {
						super(), (this.payload = e), (this.id = "EDIT_MATTERTAG_ICON")
					}
				}
				class ResetIconCommand extends Command {
					constructor(e) {
						super(), (this.payload = e), (this.id = "RESET_MATTERTAG_ICON")
					}
				}
				class SvgLoader {
					constructor(e) {
						this.queue = e
					}
					async load(e) {
						const t = await this.queue.get(e, { responseType: "text" }),
							o = document.createElement("div")
						o.innerHTML = t
						const n = o.querySelector("svg")
						if (!n) throw Error("Failed trying to load " + e + "as an svg.")
						const r = n.getAttribute("width"),
							a = n.getAttribute("height")
						return (
							r || a
								? (a &&
										!r &&
										(B.warn(e, "does not have a defined width. Defaulting width equal to height"),
										n.setAttribute("width", a)),
								  r &&
										!a &&
										(B.warn(e, "does not have a defined height. Defaulting height equal to width"),
										n.setAttribute("height", r)))
								: (B.warn(e, "does not have a defined size. Defaulting to a 128x128 resolution"),
								  n.setAttribute("width", SvgLoader.defaultResolution),
								  n.setAttribute("height", SvgLoader.defaultResolution)),
							new Promise(e => {
								const t = new Image()
								;(t.onload = () => e(t)),
									(t.src = URL.createObjectURL(new Blob([n.outerHTML], { type: "image/svg+xml" })))
							})
						)
					}
				}
				function q(e) {
					if (null == e || isNaN(e)) return !1
					if ("number" == typeof e) return !0
					const t = parseFloat(e)
					return !isNaN(t) && "number" == typeof t
				}
				function H(e) {
					return e - 0
				}
				function j(e) {
					return !!e && !!("object" == typeof e && "x" in e && "y" in e && "z" in e && q(e.x) && q(e.y) && q(e.z))
				}
				SvgLoader.defaultResolution = "128"
				const W = new Logger("util")
				function $(e) {
					return (
						!!((t = e) && "object" == typeof t && "r" in t && "g" in t && "b" in t && q(t.r) && q(t.g) && q(t.b)) &&
						(A(e.r, 0, 1) || W.warn("The color provided should have an r value be in the range of [0, 1]"),
						A(e.g, 0, 1) || W.warn("The color provided should have an g value be in the range of [0, 1]"),
						A(e.b, 0, 1) || W.warn("The color provided should have an b value be in the range of [0, 1]"),
						((o = e).r = O(o.r, 0, 1)),
						(o.g = O(o.g, 0, 1)),
						(o.b = O(o.b, 0, 1)),
						!0)
					)
					var t, o
				}
				const K = new Logger("mattertag-util")
				function Z(e, t, o, n) {
					const r = n.meshSubGroupsFromPoint(e)
					let a = 1 / 0,
						s = ""
					for (const t of o.rooms())
						if (r.find(e => e.meshGroup === t.meshGroup && e.meshSubgroup === t.meshSubgroup)) {
							const o = n.meshGroups.rooms.get(t.meshGroup, t.meshSubgroup),
								r = e.y - ((null == o ? void 0 : o.boundingBox.min.y) || -1 / 0)
							r < a && ((a = r), (s = t.floorId))
						}
					try {
						return t.getFloor(s).index
					} catch (e) {
						return K.debug("Unable to deduce floor index from position; defaulting to floor 0"), 0
					}
				}
				class BatchAddMattertagCommand extends Command {
					constructor(e) {
						super(), (this.payload = e), (this.id = "BATCH_ADD_MATTERTAG")
					}
				}
				function Y(e, t, o, n, r) {
					const a = {
						[L.NONE]: o.TagDescriptionChunkType.none,
						[L.PHOTO]: o.TagDescriptionChunkType.photo,
						[L.VIDEO]: o.TagDescriptionChunkType.video,
						[L.RICH]: o.TagDescriptionChunkType.rich
					}
					function s(e, n, r, s) {
						if (!j(e.anchorPosition)) throw Error("anchorPosition is not a valid Vector3")
						if (!j(e.stemVector)) throw Error("stemVector is not a valid Vector3")
						const i = new t.Vector3().copy(e.anchorPosition),
							d = new t.Vector3().copy(e.stemVector),
							c = d.length()
						d.normalize()
						let u = void 0 !== e.floorIndex ? e.floorIndex : e.floorId
						void 0 === u && (u = Z(i, n, r, s))
						const p = n.getFloorAtIndex(u)
						if (!p) throw new Error(`Could not add Mattertag on invalid floor with index: ${u}`)
						const m = $(e.color) ? new t.Color(e.color.r, e.color.g, e.color.b) : o.Color.MATTERTAG_BLUE,
							l = e.description,
							h = e.label,
							g = !e.hasOwnProperty("stemVisible") || e.stemVisible
						let w
						return (
							e.media &&
								(w = { mediaType: a[e.media.type] || o.TagDescriptionChunkType.none, mediaSrc: e.media.src || "" }),
							new o.AddMattertagCommand(
								{ position: i, normal: d, floorId: p.id },
								{ color: m, description: l, label: h, stemHeight: c, stemVisible: g, enabled: !0 },
								w
							)
						)
					}
					e.addCommandCreator({ namespace: "Mattertag", name: "add", args: ["tags"] }, e => {
						const t = Array.isArray(e.tags) ? e.tags : [e.tags]
						return new BatchAddMattertagCommand(t)
					}),
						n.addBinding(BatchAddMattertagCommand, async e => {
							const [t, o, a] = await r.getDependencies(),
								i = (function (e, t, o, n) {
									const r = [],
										a = e,
										i = a.length
									r.length = i
									for (let e = 0; e < a.length; ++e)
										try {
											r[e] = s(a[e], t, o, n)
										} catch (t) {
											throw Error(`Error in tag ${e} - ${t.message}`)
										}
									return r
								})(e, t, o, a),
								d = []
							d.length = i.length
							for (let t = 0; t < i.length; ++t) {
								const o = await n.issueCommand(i[t])
								d[t] = o
								const r = e[t]
								r.iconId && (await n.issueCommand(new EditIconCommand({ tagId: o, iconId: r.iconId })))
							}
							return d
						})
				}
				class GetMattertagDataCommand extends Command {
					constructor() {
						super(...arguments), (this.id = "MATTERTAG_GET")
					}
				}
				function X(e, t, o) {
					function n(e) {
						if (!e) return
						return { label: e.label, type: o.toSdkLinkType(e.type), url: e.url, navigationData: e.navigationData }
					}
					const r = []
					for (const o of e) r.push({ type: t.toSdkChunkType(o.type), link: n(o.link), text: o.text })
					return r
				}
				var Q
				!(function (e) {
					;(e.LABEL = "label"), (e.DESCRIPTION = "description"), (e.MEDIA = "media")
				})(Q || (Q = {}))
				class EditBillboardCommand extends Command {
					constructor(e, t) {
						super(), (this.payload = { tagId: e, properties: t })
					}
				}
				class EditColorCommand extends Command {
					constructor(e, t) {
						super(), (this.payload = { tagId: e, color: t })
					}
				}
				const J = new Logger("command.editOpacity")
				class EditOpacityExecutor {
					validateInput(e, t) {
						const o = e.sid
						if (!U(o)) throw new TagIdInputException(o)
						if (!t.getTag(o)) throw Error(e.sid + " is not a valid Mattertag sid")
						if ("number" != typeof e.opacity || isNaN(e.opacity))
							throw Error(e.opacity + " is not a valid opacity value")
						let n = e.opacity
						return (
							(n < 0 || 1 < n) && (J.warn(n, "is outside the valid range of [0, 1]"), (n = O(n, 0, 1))),
							{ sid: o, opacity: n }
						)
					}
					exec(e, t, o, n) {
						n.changeDiscOpacity(e.sid, e.opacity), t.return()
					}
				}
				function ee(e, t, o) {
					return ((o = o || {}).x = e[t].x), (o.y = e[t].y), (o.z = e[t].z), o
				}
				function te(e, t) {
					return ((t = t || {}).id = e.id), (t.sequence = e.index), t
				}
				class MattertagSubFactory {
					create(e, t) {
						return t.onChanged(() => e.onChanged())
					}
				}
				class MattertagDataCollection {
					constructor(e) {
						;(this._data = {}), (this.mediaConverter = e.mediaConverter)
					}
					get data() {
						return this._data
					}
					isItemEqual(e, t) {
						return !p(this.data[t], e.data[t])
					}
					update(e, t, o) {
						for (const s of e.getTagList()) {
							const i = e.getTag(s),
								d = t.getFloor(i.floorId),
								c = this.data[i.sid] || {}
							;(c.sid = i.sid),
								(c.enabled = i.enabled),
								(c.anchorPosition = ee(i, "anchorPosition", c.anchorPosition)),
								(c.stemVector = ee(i, "stemVector", c.stemVector)),
								(c.stemVisible = i.stemVisible),
								(c.label = i.label),
								(c.description = i.description),
								(c.media = this.getMedia(i, c.media)),
								(c.color =
									((n = i), (r = "color"), ((a = (a = c.color) || {}).r = n[r].r), (a.g = n[r].g), (a.b = n[r].b), a)),
								(c.floorIndex = d ? d.index : -1),
								(c.floorInfo = c.floorInfo || {}),
								(c.floorInfo.id = o.getIdFromCwfId(d.id)),
								(c.floorInfo.sequence = d.index),
								(this.data[i.sid] = c)
						}
						var n, r, a
						for (const t in this.data) {
							e.getTag(t) || delete this.data[t]
						}
					}
					clear() {
						this._data = {}
					}
					getMedia(e, t) {
						const o = this.mediaConverter.toSdkMedia(e.mediaType)
						return ((t = t || {}).src = e.mediaSrc), (t.type = o || L.NONE), t
					}
				}
				const oe = {
					namespace: "Mattertag",
					name: "injectHTML",
					subRoutine: "mattertag.inject",
					args: ["tagId", "html", "options"]
				}
				var ne
				!(function (e) {
					;(e.LOADED = "inject.loaded"), (e.SETUP = "inject.setup"), (e.RESOLVE = "inject.resolve")
				})(ne || (ne = {}))
				const re = new Set()
				function ae(e) {
					return !!e && "string" == typeof e
				}
				var se
				re.add(0),
					(function (e) {
						e[(e.POSTMESSAGE = 1)] = "POSTMESSAGE"
					})(se || (se = {}))
				class InjectionExecutor {
					constructor(e) {
						this.getIframeSrc = e
					}
					validateInput(e, t) {
						const o = e.tagId
						if (!ae(o)) throw new TagIdInputException(o)
						if (!t.getTag(o)) throw Error(e.tagId + " is not a valid tagId")
						if (!e.html || "string" != typeof e.html) throw Error(e.html + " is not valid html")
						if (!q(e.clientId)) throw Error("Unexpected error: unable to create iframe")
						const n = e.options || {}
						let r = "string" == typeof n.windowPath ? n.windowPath : ""
						if (r && r.split(".").filter(e => "parent" !== e && "opener" !== e).length > 0)
							throw Error(r + " is an unsupported window path")
						r.length > 0 && "." !== r[0] && (r = "." + r)
						try {
							if (!Function("return window" + r)().postMessage) throw Error("invalid window")
						} catch (e) {
							throw Error("problem finding a valid window with path: " + r)
						}
						const a = { on: "on", off: "off", send: "send" }
						n.messageFcnMapping &&
							(ae(n.messageFcnMapping.on) && (a.on = n.messageFcnMapping.on),
							ae(n.messageFcnMapping.off) && (a.off = n.messageFcnMapping.off),
							ae(n.messageFcnMapping.send) && (a.send = n.messageFcnMapping.send))
						const s = { w: 0, h: 0 }
						if (n.size) {
							const e = H(n.size.w + ""),
								t = H(n.size.h + "")
							isNaN(e) || isNaN(t) || ((s.w = e), (s.h = t))
						}
						return {
							tagId: o,
							clientId: e.clientId,
							html: e.html,
							options: { size: s, windowPath: r, messageFcnMapping: a }
						}
					}
					exec(e, t, o) {
						const n = (function () {
							let e
							do {
								e = Math.floor(1e6 * Math.random())
							} while (re.has(e))
							return re.add(e), e
						})()
						const r = (function (e) {
							const t = document.createElement("iframe")
							return (t.src = e), t.sandbox.add("allow-scripts"), t
						})(this.getIframeSrc())
						r.addEventListener("load", function () {
							const o = r.contentWindow
							t.return({ messengerType: se.POSTMESSAGE, iframeId: n }),
								o.postMessage(
									{
										type: ne.SETUP,
										id: n,
										targetId: e.clientId,
										customHTML: e.html,
										windowPath: e.options.windowPath,
										messageFcnMapping: e.options.messageFcnMapping
									},
									"*"
								)
						}),
							(o.getTag(e.tagId).widgetFrame = {
								size: { width: e.options.size.w, height: e.options.size.h },
								frame: new CustomFrame(r)
							}),
							o.commit()
					}
				}
				class CustomFrame {
					constructor(e) {
						this.iframe = e
					}
					mount(e) {
						e.appendChild(this.iframe)
					}
					unmount() {
						this.iframe.parentNode && this.iframe.parentNode.removeChild(this.iframe)
					}
				}
				class MattertagNavigateCommand extends Command {
					constructor(e, t) {
						super(), (this.id = "NAVIGATE_TO_MATTERTAG")
						const o = t
						this.payload = { sid: e, transition: o }
					}
				}
				class PreventActionExecutor {
					validateInput(e, t) {
						const o = e.sid
						if (!U(o)) throw new TagIdInputException(o)
						if (!t.mattertags.getTag(o)) throw Error(e.sid + " is not a valid tag sid")
						const n = { opening: !1, navigating: !1 }
						if ("object" == typeof e.prevent && e.prevent) {
							const t = e.prevent
							;(n.opening = !!t.opening), (n.navigating = !!t.navigating)
						}
						return { sid: o, prevent: n }
					}
					exec(e, t, o) {
						;(e.prevent.opening = !e.prevent.opening),
							(e.prevent.navigating = !e.prevent.navigating),
							o.setTagCapabilities(e.sid, e.prevent),
							t.return()
					}
				}
				class BatchRemoveMattertagCommand extends Command {
					constructor(e) {
						super(), (this.id = "BATCH_REMOVE_MATTERTAG"), (this.payload = { removeCommands: e })
					}
				}
				class MattertagOpenCommand extends Command {
					constructor(e) {
						super(), (this.id = "MATTERTAG_OPEN"), (this.payload = { tag: e })
					}
				}
				class MattertagCloseCommand extends Command {
					constructor(e) {
						super(), (this.id = "MATTERTAG_CLOSE"), (this.payload = { tag: e })
					}
				}
				class GetMeasurementsDataCommand extends Command {
					constructor() {
						super(...arguments), (this.id = "MEASUREMENTS_GET")
					}
				}
				const ie = async (e, t) => {
					const o = []
					for (const n of e.groups()) {
						const e = n.info,
							r = t.getFloor(e.floorId)
						for (let t = 1; t < n.count - 1; t++) {
							const a = n.get(t - 1),
								s = n.get(t)
							o.push({
								sid: e.sid,
								label: e.text,
								floor: r.index,
								start: { x: a.x, y: a.y, z: a.z },
								end: { x: s.x, y: s.y, z: s.z }
							})
						}
					}
					return o
				}
				class MeasurementModeSubFactory {
					constructor(e) {
						this.CwfMeasuringPhase = e
					}
					create(e, t) {
						let o = t.groupCount,
							n = t.phase
						const r = () => {
							const r = t.groupCount,
								a = t.phase
							;(o === r && n !== this.CwfMeasuringPhase.EDITING) ||
								a !== this.CwfMeasuringPhase.IDLE ||
								(e.onChanged(), (o = r)),
								(n = a)
						}
						return new AggregateSubscription(t.onPhaseChanged(r), t.onSelectedGroupIndexChanged(r))
					}
				}
				class MeasurementDataCollection {
					constructor() {
						this.data = {}
					}
					update(e) {
						for (const t of e.groups()) this.createMeasurement(t)
						for (const t in this.data) {
							e.getGroupInfoBySid(t) || delete this.data[t]
						}
					}
					isItemEqual(e, t) {
						return !p(this.data[t], e.data[t])
					}
					clear() {
						this.data = {}
					}
					createMeasurement(e) {
						const t = e.info.sid,
							o = this.data[t] || {},
							n = o.points || []
						!(function (e, t) {
							let o = 0
							for (const n of t) {
								const t = e[o] || {}
								;(t.x = n.x), (t.y = n.y), (t.z = n.z), (e[o] = t), ++o
							}
							e.length = o
						})(n, e),
							(o.sid = t),
							(o.points = n),
							(this.data[t] = o)
					}
				}
				class MeasurementPhaseSubFactory {
					create(e, t) {
						return t.onChanged(() => e.onChanged())
					}
				}
				class MeasurementModeObservable {
					constructor() {
						this._data = { active: !1 }
					}
					get data() {
						return this._data
					}
					equals(e) {
						return this._data.active === e.data.active
					}
					copy(e) {
						this._data.active = e.data.active
					}
					update(e) {
						this._data.active = e.modeActive()
					}
				}
				class ToggleMeasureModeCommand extends Command {
					constructor(e) {
						super(), (this.id = "SDK_MEASUREMENT_TOGGLE"), (this.payload = { active: e })
					}
				}
				var de
				!(function (e) {
					;(e.CHANGE_START = "viewmode.changestart"), (e.CHANGE_END = "viewmode.changeend")
				})(de || (de = {}))
				class ViewmodeActiveTransitionError extends BaseException_BaseException {
					constructor(e = "Tried to start view-mode transition while another transition was active") {
						super(e), (this.name = "ViewmodeActiveTransition")
					}
				}
				const ce = new Logger("move-to-mode-command")
				class MoveToModeCommand extends Command {
					constructor(e) {
						super(), (this.id = "MOVE_TO_MODE"), (this.payload = e)
					}
				}
				class MoveToModeValidation {
					constructor(e, t, o, n) {
						;(this.THREE = e), (this.CmdViewmode = t), (this.conversion = o), (this.transitionTypeConverter = n)
					}
					validateMoveToModeInput(e) {
						if (!e) throw Error("Mode.moveTo -> no arguments provided -- mode is required")
						e.options || (e.options = {})
						const t = e.mode
						if (!f(this.CmdViewmode, e.mode)) throw Error(`Mode.moveTo -> ${e.mode} is not a valid viewmode`)
						if (t === this.CmdViewmode.TRANSITIONING) throw Error(`Mode.moveTo -> ${e.mode} is not a valid viewmode`)
						e.options && e.options.rotation && (e.options.rotation.z = e.options.rotation.z || 0)
						const o = this.validatePayloadOptions(e.options)
						return {
							mode: t,
							options: { transition: o.transition, position: o.position, rotation: o.rotation, zoom: o.zoom }
						}
					}
					validatePayloadOptions(e) {
						let t, o, n, r
						if (e) {
							if (e.transition && ((n = this.transitionTypeConverter.fromSdkTransition(e.transition)), void 0 === n))
								throw Error(`Mode.moveTo -> ${e.transition} is not a valid transition style`)
							e.rotation && j(e.rotation) && (t = this.conversion.rotationToQuaternion(e.rotation)),
								e.position &&
									j(e.position) &&
									(o = new this.THREE.Vector3(
										parseFloat(e.position.x),
										parseFloat(e.position.y),
										parseFloat(e.position.z)
									)),
								e.zoom && !isNaN(e.zoom) && (r = O(e.zoom, 1, 30))
						}
						return { rotation: t, position: o, transition: n, zoom: r }
					}
				}
				class GetModelDataCommand extends Command {
					constructor() {
						super(...arguments), (this.id = "GET_MODEL_DATA")
					}
				}
				function ue(e, t, o) {
					t.addBinding(GetModelDataCommand, async () => {
						const e = await o.getDependencies()
						return await (async function (e, o, n, r) {
							const a = { sid: "", sweeps: [], modelSupportsVr: !1 }
							try {
								const s = o.getSweepList(),
									i = e.model
								return await t.makeModelData(i.sid, i.options.isVR, s, n, r, a), a
							} catch (e) {
								throw Error("no model currently loaded")
							}
						})(...e)
					}),
						e.addCommandCreator({ namespace: "Model", name: "getData", args: [] }, () => new GetModelDataCommand())
				}
				class GetModelDetailsCommand extends Command {
					constructor() {
						super(...arguments), (this.id = "GET_MODEL_DETAILS")
					}
				}
				function pe(e, t, o, n) {
					n.getDependencies().then(e =>
						o.addBinding(GetModelDetailsCommand, async () =>
							(function (e, o) {
								function n(e, t) {
									if (o.tryGetProperty(e, !0)) return t
								}
								const r = e.model
								return {
									sid: r.sid,
									name: n(t.OptionsKey.DetailsModelName, r.details.name),
									presentedBy: n(t.OptionsKey.PresentedBy, r.details.presentedBy),
									summary: n(t.OptionsKey.DetailsSummary, r.details.summary),
									formattedAddress: n(t.OptionsKey.DetailsAddress, r.details.formattedAddress),
									contactEmail: n(t.OptionsKey.DetailsEmail, r.details.contact.email),
									contactName: n(t.OptionsKey.DetailsName, r.details.contact.name),
									phone: n(t.OptionsKey.DetailsPhone, r.details.contact.phone),
									formattedContactPhone: n(t.OptionsKey.DetailsPhone, r.details.contact.formattedPhone),
									externalUrl: n(t.OptionsKey.DetailsExternalUrl, r.details.externalUrl)
								}
							})(...e)
						)
					),
						e.addCommandCreator(
							{ namespace: "Model", name: "getDetails", args: [] },
							() => new GetModelDetailsCommand()
						)
				}
				var me
				!(function (e) {
					e.MODEL_LOADED = "model.loaded"
				})(me || (me = {}))
				function le(e, t) {
					return async function (o, n, r, a, s, i) {
						i.sweeps = []
						for (const o of r) {
							const n = o.floorId ? a.getFloor(o.floorId).index : -1
							i.sweeps.push({
								uuid: s.getIdForSweep(o),
								sid: s.getIdForSweep(o),
								alignmentType: t.toSdkAlignment(o.alignmentType),
								placementType: t.toSdkPlacement(o.placementType),
								neighbors: await Promise.all(o.neighbours.map(async e => await s.getIdFromCwfId(e))),
								position: ((d = o), null !== d.position ? { x: d.position.x, y: d.position.y, z: d.position.z } : null),
								rotation: e.quaternionToRotation(o.rotation),
								floor: n
							})
						}
						var d
						return (i.sid = o), (i.modelSupportsVr = n), i
					}
				}
				var he, ge
				!(function (e) {
					;(e.NONE = "intersectedobject.none"),
						(e.MODEL = "intersectedobject.model"),
						(e.TAG = "intersectedobject.tag"),
						(e.SWEEP = "intersectedobject.sweep"),
						(e.UNKNOWN = "intersectedobject.unknown")
				})(he || (he = {}))
				class PointerSubFactory {
					create(e, t) {
						return t.onChanged(() => e.onChanged())
					}
				}
				class ObservablePointer {
					constructor(e, t) {
						;(this.colliderTypes = t),
							(this.ZERO = new e.Vector3(0, 0, 0)),
							(this.tempVec = new e.Vector3()),
							(this._data = {
								position: { x: 0, y: 0, z: 0 },
								normal: { x: 0, y: 0, z: 0 },
								object: he.NONE,
								floorId: void 0,
								floorIndex: void 0
							})
					}
					get data() {
						return this._data
					}
					equals(e) {
						const t = 1e-5,
							o = e.data.position,
							n = this._data.position,
							r = e.data.normal,
							a = this._data.normal
						return I(o, n, t) && I(r, a, t) && e.data.object === this._data.object
					}
					update(e, t, o, n) {
						const r = e.hit
						r
							? (y(this._data.position, r.point),
							  y(this._data.normal, r.face.normal),
							  (this._data.floorId = void 0),
							  r.object instanceof this.colliderTypes.ModelColliderTarget
									? ((this._data.object = he.MODEL),
									  (this._data.floorId = (function (e, t, o, n, r) {
											let a
											if (
												(function (e) {
													const { object: t } = e
													return "object" == typeof t && "floorId" in t
												})(e)
											)
												return (a = t.getFloor(e.object.floorId)), a.index
											r.copy(e.point)
											const s = n.meshSubGroupsFromPoint(r)
											if (!s.length) return
											const { meshGroup: i, meshSubgroup: d } = s[0],
												c = o.getByMeshSubgroup(i, d)
											if (!c) return
											return (a = t.getFloor(c.floorId)), a.index
									  })(r, t, o, n, this.tempVec)))
									: r.object instanceof this.colliderTypes.PinHeadMesh ||
									  r.object instanceof this.colliderTypes.InstancedPinHeads
									? (this._data.object = he.TAG)
									: r.object instanceof this.colliderTypes.PuckCollider
									? (this._data.object = he.SWEEP)
									: (this._data.object = he.UNKNOWN))
							: (y(this._data.position, this.ZERO),
							  y(this._data.normal, this.ZERO),
							  (this._data.object = he.NONE),
							  (this._data.floorId = void 0)),
							(this._data.floorIndex = this._data.floorId)
					}
					copy(e) {
						y(this._data.position, e.data.position),
							y(this._data.normal, e.data.normal),
							(this._data.object = e.data.object),
							(this._data.floorId = e.data.floorId),
							(this._data.floorIndex = e.data.floorIndex)
					}
				}
				class ScreenCapturer {
					constructor(e, t) {
						;(this.captureCamera = e), (this.encodeRenderTarget = t)
					}
					async capture(e, t, o, n) {
						const { camera: r, scene: a } = t.getScene()
						return (
							r.getWorldPosition(this.captureCamera.position),
							r.getWorldQuaternion(this.captureCamera.quaternion),
							this.captureCamera.projectionMatrix.copy(r.projectionMatrix),
							(this.captureCamera.layers.mask = e.visibleObjects.mask),
							n.setSize(e.resolution.width, e.resolution.height),
							o.render(n.target, a, this.captureCamera),
							await this.encodeRenderTarget(n)
						)
					}
				}
				!(function (e) {
					;(e.Base64JPG = "screenshot.base64.jpg"), (e.ArrayBufferJPG = "screenshot.arraybuffer.jpg")
				})(ge || (ge = {}))
				class ScreenshotExecutor {
					constructor(e, t, o) {
						;(this.RenderLayers = t.RenderLayers),
							(this.screenCapturer = e),
							(this.requestTarget = o.requestTarget),
							(this.getRenderLayer = o.getRenderLayer),
							(this.jpegAsBase64 = o.jpegAsBase64)
					}
					validateInput(e, t, o, n) {
						return {
							resolution: this.validateResolution(e.resolution, t, o),
							visibleObjects: this.buildVisibilityOptions(e.visibleObjects),
							returnType: e.returnType === ge.ArrayBufferJPG ? ge.ArrayBufferJPG : ge.Base64JPG
						}
					}
					async exec(e, t, o, n, r) {
						const a = await this.requestTarget(),
							s = await this.screenCapturer.capture(
								{ resolution: e.resolution, visibleObjects: this.buildVisibilityLayers(e.visibleObjects) },
								n,
								r,
								a
							)
						e.returnType === ge.ArrayBufferJPG && t.return(s.buffer), t.return(this.jpegAsBase64(s))
					}
					validateResolution(e, t, o) {
						const n = { width: 0, height: 0 }
						if (!e) return (n.width = t.width), (n.height = t.height), n
						if (
							!(function (e) {
								const t = e
								return !!t && "number" == typeof t.width && "number" == typeof t.height
							})(e)
						)
							throw Error('"resolution" provided was not valid. Expected .width and .height to be numbers.')
						;(n.width = e.width), (n.height = e.height)
						const r = o.maxTextureSize
						if (e.width <= 0 || e.width > r)
							throw Error('"resolution.width" provided was outside the valid range of [0, ' + r + "]")
						if (e.height <= 0 || e.height > r)
							throw Error('"resolution.height" provided was outside the valid range of [0, ' + r + "]")
						return n
					}
					buildVisibilityOptions(e) {
						const t = e || {}
						return { measurements: !!t.measurements, mattertags: !!t.mattertags, sweeps: !!t.sweeps, views: !!t.views }
					}
					buildVisibilityLayers(e) {
						const t = this.RenderLayers.ALL
						return (
							e.mattertags || t.removeLayers(this.getRenderLayer("pins")),
							e.measurements || t.removeLayers(this.getRenderLayer("measurements")),
							e.sweeps || t.removeLayers(this.getRenderLayer("sweep-pucks")),
							e.views ||
								(t.removeLayers(this.getRenderLayer("sweep-portal-mesh")),
								t.removeLayers(this.getRenderLayer("sweep-pin-mesh"))),
							t
						)
					}
				}
				class EquirectangularExecutor {
					constructor(e, t, o) {
						;(this.Viewmode = t.Viewmode),
							(this.requestTarget = o.requestTarget),
							(this.encodeRenderTarget = o.encodeRenderTarget),
							(this.jpegAsBase64 = o.jpegAsBase64),
							(this.getXmp = o.getXmp),
							(this.getOrientedAngleTo = o.getOrientedAngleTo),
							(this.forward = new e.Vector3(0, 0, -1)),
							(this.sweepForward = new e.Vector3()),
							(this.viewForward = new e.Vector3())
					}
					validateInput(e) {
						return e
					}
					async exec(e, t, o, n, r, a, s) {
						if (!a.currentSweep || r.currentMode !== this.Viewmode.Panorama)
							throw new Error("Can only capture equirectangular projections while stationary in a sweep")
						const i = o.getScene().camera,
							d = a.getSweep(a.currentSweep),
							c = await s.load(d)
						this.sweepForward.copy(this.forward),
							this.sweepForward.copy(this.forward).applyQuaternion(d.rotation).setY(0)
						const u =
								this.getOrientedAngleTo(this.sweepForward, i.getWorldDirection(this.viewForward).setY(0)) + Math.PI,
							p = await this.requestTarget()
						p.setSize(
							EquirectangularExecutor.equirectangularRes.width,
							EquirectangularExecutor.equirectangularRes.height
						),
							n.renderEquirectangular(c, p.target, u)
						const m = await this.encodeRenderTarget(p, this.getXmp(p.width, p.height, 0, 0))
						t.return(this.jpegAsBase64(m))
					}
				}
				EquirectangularExecutor.equirectangularRes = { width: 4096, height: 2048 }
				class WorldToScreen {
					constructor(e, t) {
						;(this.issueCommand = t.issueCommand), (this.GetScreenPositionCommand = e.GetScreenPositionCommand)
					}
					validateInput(e) {
						if (!j(e.worldPosition))
							throw Error(
								`Renderer.getScreenPosition: 'worldPosition' was specified but was not a valid Vector3; got ${e.worldPosition}`
							)
						return e
					}
					async exec(e, t) {
						const o = await this.issueCommand(new this.GetScreenPositionCommand(e))
						t.return(o)
					}
				}
				class WorldPositionExecutor {
					constructor(e, t) {
						;(this.GetFloorIntersectCommand = e.GetFloorIntersectCommand), (this.issueCommand = t.issueCommand)
					}
					validateInput(e) {
						if (
							!(function (e) {
								if (e && "object" == typeof e && "x" in e && "y" in e) {
									const t = e
									return q(t.x) && q(t.y)
								}
								return !1
							})(e.screenPosition)
						)
							throw Error(
								`Renderer.getWorldPositionData: 'screenPosition' was not a valid Vector2; got ${e.screenPosition}`
							)
						return e
					}
					async exec(e, t, o) {
						const n = await this.issueCommand(new this.GetFloorIntersectCommand(e)),
							r = o.getFloorAtIndex(n.floorIndex)
						r
							? t.return({ position: n.position, floorInfo: { id: r.id, sequence: r.index }, floor: n.floorIndex })
							: t.return({ position: n.position, floorInfo: { id: "", sequence: -1 }, floor: -1 })
					}
				}
				class CurrentRoomSubFactory {
					constructor() {
						;(this.wasTransitioning360 = !1), (this.cameraPosition = { x: 0, y: 0, z: 0 })
					}
					create(e, t, o, n) {
						return new AggregateSubscription(
							o.onChanged(() => this.throttleCameraPositionChanges(e, o)),
							n.onChanged(() => this.throttleSweepChanges(e, n))
						)
					}
					throttleCameraPositionChanges(e, t) {
						const o = t.pose.position
						;(o.x === this.cameraPosition.x && o.y === this.cameraPosition.y && o.z === this.cameraPosition.z) ||
							((this.cameraPosition.x = o.x),
							(this.cameraPosition.y = o.y),
							(this.cameraPosition.z = o.z),
							e.onChanged())
					}
					throttleSweepChanges(e, t) {
						const o = t.transition
						t.transitionActive
							? (t.isSweepUnaligned(o.from) || t.isSweepUnaligned(o.to)) && (this.wasTransitioning360 = !0)
							: this.wasTransitioning360 &&
							  !t.isSweepUnaligned(t.currentSweep) &&
							  (e.onChanged(), (this.wasTransitioning360 = !1))
					}
				}
				class CurrentRoomObservable {
					constructor() {
						this.currentRooms = { rooms: [] }
					}
					get data() {
						return this.currentRooms
					}
					equals(e) {
						return (
							this.data.rooms.length === e.data.rooms.length &&
							this.currentRooms.rooms.every(t => e.data.rooms.findIndex(e => e.id === t.id) > -1)
						)
					}
					copy(e) {
						;(this.currentRooms.rooms.length = e.data.rooms.length),
							(function (e, t) {
								const o = t.length
								e.length = o
								for (let n = 0; n < o; ++n) e[n] = t[n]
							})(this.currentRooms.rooms, e.data.rooms)
					}
					update(e, t, o, n, r, a, s) {
						if (
							(r.isInside() && o.isSweepUnaligned(o.currentSweep)) ||
							(o.transitionActive && (o.isSweepUnaligned(o.transition.to) || o.isSweepUnaligned(o.transition.from)))
						)
							return void (this.currentRooms.rooms.length = 0)
						const i = a.meshSubGroupsFromPoint(t.pose.position)
						this.currentRooms.rooms.length = i.length
						for (let t = 0; t < i.length; ++t) {
							const { meshGroup: o, meshSubgroup: r } = i[t],
								d = e.getByMeshSubgroup(o, r),
								c = a.meshGroups.rooms.get(o, r)
							if (!d || !c) continue
							const u = this.currentRooms.rooms[t] || {}
							;(u.id = s.getIdFromCwfId(d.id)),
								(u.bounds = u.bounds || {}),
								(u.bounds.min = ee(c.boundingBox, "min", u.bounds.min)),
								(u.bounds.max = ee(c.boundingBox, "max", u.bounds.max))
							const p = n.getFloor(d.floorId)
							;(u.floorInfo = te(p, u.floorInfo)), (this.currentRooms.rooms[t] = u)
						}
					}
				}
				class RoomSubFactory {
					create(e, t, o) {
						return { renew() {}, cancel() {} }
					}
				}
				class RoomCollectionData {
					constructor() {
						this._data = {}
					}
					get data() {
						return this._data
					}
					isItemEqual(e, t) {
						const o = this.data[t],
							n = e.data[t]
						return o.id === n.id && I(o.bounds.min, n.bounds.min) && I(o.bounds.max, n.bounds.max)
					}
					update(e, t, o, n) {
						for (const r of e.rooms()) {
							const e = n.meshGroups.rooms.get(r.meshGroup, r.meshSubgroup)
							if (!e) continue
							const a = o.getIdFromCwfId(r.id),
								s = this._data[a] || {}
							;(s.id = a),
								(s.bounds = s.bounds || {}),
								(s.bounds.min = ee(e.boundingBox, "min", s.bounds.min)),
								(s.bounds.max = ee(e.boundingBox, "max", s.bounds.max))
							const i = t.getFloor(r.floorId)
							;(s.floorInfo = te(i, s.floorInfo)), (this._data[a] = s)
						}
						for (const e in this.data) {
							o.getRoomForId(e) || delete this._data[e]
						}
					}
					clear() {
						this._data = {}
					}
				}
				new Logger("ScenePath")
				var we, fe, Ce, ye
				!(function (e) {
					;(e.OUTPUT = "output"), (e.INPUT = "input"), (e.EVENT = "event"), (e.EMIT = "emit")
				})(we || (we = {}))
				!(function (e) {
					;(e.CLICK = "INTERACTION.CLICK"),
						(e.HOVER = "INTERACTION.HOVER"),
						(e.DRAG = "INTERACTION.DRAG"),
						(e.DRAG_BEGIN = "INTERACTION.DRAG_BEGIN"),
						(e.DRAG_END = "INTERACTION.DRAG_END"),
						(e.POINTER_MOVE = "INTERACTION.POINTER_MOVE"),
						(e.POINTER_BUTTON = "INTERACTION.POINTER_BUTTON"),
						(e.SCROLL = "INTERACTION.SCROLL"),
						(e.KEY = "INTERACTION.KEY"),
						(e.LONG_PRESS_START = "INTERACTION.LONG_PRESS_START"),
						(e.LONG_PRESS_END = "INTERACTION.LONG_PRESS_END"),
						(e.MULTI_SWIPE = "INTERACTION.MULTI_SWIPE"),
						(e.MULTI_SWIPE_END = "INTERACTION.MULTI_SWIPE_END"),
						(e.PINCH = "INTERACTION.PINCH"),
						(e.PINCH_END = "INTERACTION.PINCH_END"),
						(e.ROTATE = "INTERACTION.ROTATE"),
						(e.ROTATE_END = "INTERACTION.ROTATE_END")
				})(fe || (fe = {})),
					(function (e) {
						;(e.OBJ_LOADER = "mp.objLoader"),
							(e.FBX_LOADER = "mp.fbxLoader"),
							(e.DAE_LOADER = "mp.daeLoader"),
							(e.GLTF_LOADER = "mp.gltfLoader"),
							(e.SCROLLING_TUBE = "mp.scrollingTube"),
							(e.TRANSFORM_CONTROLS = "mp.transformControls"),
							(e.LIGHTS_COMPONENT = "mp.lights"),
							(e.POINT_LIGHT = "mp.pointLight"),
							(e.DIRECTIONAL_LIGHT = "mp.directionalLight"),
							(e.AMBIENT_LIGHT = "mp.ambientLight"),
							(e.CAMERA = "mp.camera"),
							(e.INPUT = "mp.input"),
							(e.XR = "mp.xr")
					})(Ce || (Ce = {}))
				class RegisterCommand extends Command {
					constructor(e) {
						super(), (this.id = "SCENE_REGISTER"), (this.payload = e)
					}
				}
				class CreateNodeCommand extends Command {
					constructor(e) {
						super(), (this.id = "SCENE_CREATE_NODE"), (this.payload = e)
					}
				}
				class QueryCommand extends Command {
					constructor(e) {
						super(), (this.id = "SCENE_QUERY"), (this.payload = e)
					}
				}
				class ConfigureCommand extends Command {
					constructor(e) {
						super(), (this.id = "SCENE_CONFIGURE"), (this.payload = e)
					}
				}
				class GetImageCommand extends Command {
					constructor(e) {
						super(), (this.id = "SCENE_GETIMAGE"), (this.payload = e)
					}
				}
				class DeserializeCommand extends Command {
					constructor(e) {
						super(), (this.id = "SCENE_EXPORT"), (this.payload = e)
					}
				}
				class SerializeCommand extends Command {
					constructor(e) {
						super(), (this.id = "SCENE_EXPORT"), (this.payload = e)
					}
				}
				class CreateNodesCommand extends Command {
					constructor(e) {
						super(), (this.id = "SCENE_CREATE_NODES"), (this.payload = e)
					}
				}
				class RegisterComponentsCommand extends Command {
					constructor(e) {
						super(), (this.id = "SCENE_REGISTER_COMPONENTS"), (this.payload = e)
					}
				}
				class CreateObjectsCommand extends Command {
					constructor(e) {
						super(), (this.id = "SCENE_CREATE_OBJECTS"), (this.payload = e)
					}
				}
				class SensorShowDebugExecutor {
					validateInput(e, t, o) {
						if (!ae(e.sensorId) || !o.has(e.sensorId))
							throw Error("dev error: this should not occur unless the sdk was not setup properly")
						if (
							!(function (e) {
								return "boolean" == typeof e
							})(e.show)
						)
							throw Error(`Sensor.showDebug: 'show' was not a boolean; got ${e.show}`)
						return { sensorId: e.sensorId, show: e.show }
					}
					exec(e, t, o, n) {
						if (e.show) {
							const t = n.get(e.sensorId)
							o.setDebugSensor(t)
						} else o.setDebugSensor(null)
						t.return()
					}
				}
				class SensorReadingCollection {
					constructor() {
						;(this.sourceMap = new Map()),
							(this.reverseSourceLookup = new Map()),
							(this.sourceId = 0),
							(this._data = {})
					}
					get data() {
						return this._data
					}
					isItemEqual(e, t) {
						return e.data[t].inRange === this.data[t].inRange && e.data[t].inView === this.data[t].inView
					}
					update(e) {
						for (const [t, o] of e.readings) {
							const e = this.addOrGetSourceId(t),
								n = this._data[e] || {}
							;(n.inRange = o.inRange),
								(n.inView = o.inView),
								(n.distanceSquared = o.distanceSq),
								(n.direction = ee(o, "direction", n.direction)),
								(this._data[e] = n)
						}
						for (const t in this.data) {
							const o = this.reverseSourceLookup.get(t)
							o &&
								!e.readings.get(o) &&
								(this.sourceMap.delete(o), this.reverseSourceLookup.delete(t), delete this._data[t])
						}
					}
					clear() {
						this._data = {}
					}
					addOrGetSourceId(e) {
						const t = this.sourceMap.get(e)
						if (t) return t
						const o = "source-" + ++this.sourceId
						return this.sourceMap.set(e, o), this.reverseSourceLookup.set(o, e), o
					}
				}
				class DependencyFetcher {
					constructor(...e) {
						this.dependencies = e
					}
					async getDependencies() {
						return Promise.all(this.dependencies)
					}
					static extend(e, ...t) {
						return new DependencyFetcher(...e.dependencies, ...t)
					}
					static combine(e, t) {
						return new DependencyFetcher(...e.dependencies, ...t.dependencies)
					}
				}
				!(function (e) {
					e.CAMERA = "sensor.sensortype.camera"
				})(ye || (ye = {}))
				const Se = { namespace: "Sensor", name: "createSensor", subRoutine: "sensor.create", args: [] }
				class SensorStateObservable {
					constructor() {
						this._data = { origin: { x: 0, y: 0, z: 0 }, forward: { x: 0, y: 0, z: -1 } }
					}
					get data() {
						return this._data
					}
					equals(e) {
						const t = 1e-5
						return I(this.data.origin, e.data.origin, t) && I(this.data.forward, e.data.forward, t)
					}
					copy(e) {
						y(this._data.origin, e.data.origin), y(this._data.forward, e.data.forward)
					}
					update(e) {
						y(this._data.origin, e.frustum.origin), y(this._data.forward, e.frustum.forward)
					}
				}
				class CreateSensorExecutor {
					constructor(e, t) {
						;(this.sdkModule = e), (this.sensorFactories = t)
					}
					validateInput(e) {
						if (!f(ye, e.type)) throw Error(e.type + " is not a valid sensor type")
						return this.sensorFactories[e.type].validateInput(e)
					}
					async exec(e, t, o, n, r) {
						const a = this.sensorFactories[e.type].create(e, o),
							s = "sensor-" + ++CreateSensorExecutor.nextSensorId
						n.set(s, a)
						const i = SdkObservable.create(
								new DependencyFetcher(a),
								new SensorStateSubscriptionFactory(),
								new ClassFactory(SensorStateObservable)
							),
							d = this.sdkModule.addObservable(s, i),
							c = SdkCollection.create(
								new DependencyFetcher(a),
								new SensorReadingSubscriptionFactory(),
								new ClassFactory(SensorReadingCollection)
							),
							u = this.sdkModule.addCollection(s, c)
						r.set(s, {
							dispose() {
								d.dispose(), u.dispose()
							}
						}),
							t.return({ sensorId: s })
					}
				}
				CreateSensorExecutor.nextSensorId = 0
				class CameraSensorFactory {
					validateInput(e) {
						return e
					}
					create(e, t) {
						return t.createCameraBoundSensor()
					}
				}
				class SensorStateSubscriptionFactory {
					create(e, t) {
						return t.frustum.observe(new DependencyObserverAdaptor(e))
					}
				}
				class SensorReadingSubscriptionFactory {
					create(e, t) {
						return t.onReadingsUpdated(new DependencyObserverAdaptor(e))
					}
				}
				class DependencyObserverAdaptor {
					constructor(e) {
						this.dependencyObserver = e
					}
					notify() {
						this.dependencyObserver.onChanged()
					}
				}
				class SensorAddSourceExecutor {
					validateInput(e, t, o) {
						if (!ae(e.sensorId) || !t.has(e.sensorId))
							throw Error("dev error: this should not occur unless the sdk was not setup properly")
						if (
							!(function (e, t) {
								return !!Array.isArray(e) && e.every(t)
							})(e.sourceIds, ae)
						)
							throw Error("dev error: this should not occur unless the sdk was not setup properly")
						for (const t of e.sourceIds)
							if (!o.has(t)) throw Error("dev error: this should not occur unless the sdk was not setup properly")
						return { sensorId: e.sensorId, sourceIds: e.sourceIds }
					}
					exec(e, t, o, n) {
						const r = o.get(e.sensorId),
							a = e.sourceIds.map(n.get, n)
						r.addSource(...a), t.return()
					}
				}
				class DisposeSensorExecutor {
					validateInput(e, t) {
						if (!ae(e.sensorId) || !t.has(e.sensorId))
							throw Error("dev error: this should not occur unless the sdk was not setup properly")
						return { sensorId: e.sensorId }
					}
					exec(e, t, o, n) {
						n.get(e.sensorId).dispose()
						o.get(e.sensorId).dispose(), t.return()
					}
				}
				const Te = { namespace: "Sensor", name: "createSource", subRoutine: "source.create", args: ["type", "options"] }
				var Ie
				!(function (e) {
					;(e.SPHERE = "sensor.sourcetype.sphere"),
						(e.BOX = "sensor.sourcetype.box"),
						(e.CYLINDER = "sensor.sourcetype.cylinder")
				})(Ie || (Ie = {}))
				class SphereSource {
					constructor(e, t, o) {
						;(this.radius = 1 / 0), (this.type = e.SPHERE), (this._volume = t)
					}
					get origin() {
						return this._volume.origin
					}
					get volume() {
						return this._volume
					}
					describeVolume() {
						return { origin: this._volume.origin, radius: this._volume.radius }
					}
				}
				const Ee = Math.PI / 180
				class BoxSource {
					constructor(e, t, o) {
						;(this.type = e.BOX),
							(this._volume = t),
							(this.eulerCache = new o.Euler()),
							(this.quaternionCache = new o.Quaternion())
					}
					get origin() {
						return this._volume.origin
					}
					get volume() {
						return this._volume
					}
					describeVolume() {
						return {
							center: this._volume.center,
							size: this._volume.size,
							orientation: this.convertQuaternionToOrientation(this._volume.orientation)
						}
					}
					updateOrientation(e) {
						this.eulerCache.set(e.pitch * Ee, e.yaw * Ee, e.roll * Ee, "YXZ"),
							this.quaternionCache.setFromEuler(this.eulerCache),
							this._volume.updateOrientation(this.quaternionCache)
					}
					convertQuaternionToOrientation(e) {
						return (
							this.eulerCache.setFromQuaternion(this.quaternionCache.set(e.x, e.y, e.z, e.w)).reorder("YXZ"),
							{ yaw: this.eulerCache.y * Ee, pitch: this.eulerCache.x * Ee, roll: this.eulerCache.z * Ee }
						)
					}
				}
				class CylinderSource {
					constructor(e, t, o) {
						;(this.type = e.CYLINDER), (this._volume = t)
					}
					get origin() {
						return this._volume.origin
					}
					get volume() {
						return this._volume
					}
					describeVolume() {
						return { basePoint: this._volume.basePoint, height: this._volume.height, radius: this._volume.radius }
					}
				}
				function ve(e) {
					return !!e && "object" == typeof e
				}
				function be(e) {
					if (e && "object" == typeof e && "yaw" in e && "pitch" in e && "roll" in e) {
						const t = e
						return q(t.yaw) && q(t.pitch) && q(t.roll)
					}
					return !1
				}
				class CreateSourceExecutor {
					constructor(e) {
						this.sourceFactories = e
					}
					validateInput(e, t) {
						if (!f(Ie, e.type)) throw Error(e.type + " is not a valid source type")
						return this.sourceFactories[e.type].validateInput(e)
					}
					exec(e, t, o) {
						const n = this.sourceFactories[e.type].create(e),
							r = "source-" + ++CreateSourceExecutor.nextSourceId
						o.set(r, n), t.return({ sourceId: r, type: e.type, volume: n.describeVolume() })
					}
				}
				CreateSourceExecutor.nextSourceId = 0
				class SphereSourceFactory {
					constructor(e, t, o) {
						;(this.sourceType = e), (this.sphereVolumeFactory = t), (this.THREE = o)
					}
					validateInput(e) {
						if (ve(e.options)) {
							if (e.options.origin && !j(e.options.origin))
								throw Error(`Source.Box: 'origin' was specified but was not a valid Vector3; got ${e.options.origin}`)
							if (e.options.radius && (!q(e.options.radius) || e.options.radius < 0))
								throw Error(
									`Source.Sphere: 'height' was specified but was not a positive number or Infinity; got ${e.options.height}`
								)
						}
						const t = e.options || {}
						return {
							type: e.type,
							options: {
								origin: t.origin || { x: 0, y: 0, z: 0 },
								radius: t.hasOwnProperty("radius") ? t.radius : 1 / 0
							}
						}
					}
					create(e) {
						const t = new SphereSource(this.sourceType, new this.sphereVolumeFactory(), this.THREE),
							o = t.volume
						return o.updateOrigin(e.options.origin), o.updateRadius(e.options.radius), t
					}
				}
				class BoxSourceFactory {
					constructor(e, t, o) {
						;(this.sourceType = e), (this.boxVolumeFactory = t), (this.THREE = o)
					}
					validateInput(e) {
						if (ve(e.options)) {
							if (e.options.center && !j(e.options.center))
								throw Error(`Source.Box: 'center' was specified but was not a valid Vector3; got ${e.options.center}`)
							if (
								e.options.size &&
								(!j(e.options.size) || e.options.size.x < 0 || e.options.size.y < 0 || e.options.size.z < 0)
							)
								throw Error(`Source.Box: 'size' was specified but was not a valid Vector3; got ${e.options.size}`)
							if (e.options.orientation && !be(e.options.orientation))
								throw Error(
									`Source.Box: 'orientation' was specified but was not a valid Orientation; got ${e.options.orientation}`
								)
						}
						const t = e.options || {}
						return {
							type: e.type,
							options: {
								center: t.center || { x: 0, y: 0, z: 0 },
								size: t.size || { x: 1 / 0, y: 1 / 0, z: 1 / 0 },
								orientation: t.orientation || { yaw: 0, pitch: 0, roll: 0 }
							}
						}
					}
					create(e) {
						const t = new BoxSource(this.sourceType, new this.boxVolumeFactory(), this.THREE),
							o = t.volume
						return (
							o.updateCenter(e.options.center),
							o.updateDimensions(e.options.size),
							t.updateOrientation(e.options.orientation),
							t
						)
					}
				}
				class CylinderSourceFactory {
					constructor(e, t, o) {
						;(this.sourceType = e), (this.cylinderVolumeFactory = t), (this.THREE = o)
					}
					validateInput(e) {
						if (ve(e.options)) {
							if (e.options.basePoint && !j(e.options.basePoint))
								throw Error(
									`Source.Cylinder: 'basePoint' was specified but was not a valid Vector3; got ${e.options.basePoint}`
								)
							if (e.options.hasOwnProperty("height") && !(q(e.options.height) && e.options.height > 0))
								throw Error(
									`Source.Cylinder: 'height' was specified but was not a positive number or Infinity; got ${e.options.height}`
								)
							if (e.options.hasOwnProperty("radius") && !(q(e.options.radius) && e.options.radius > 0))
								throw Error(
									`Source.Cylinder: 'radius' was specified but was not a positive number or Infinity; got ${e.options.radius}`
								)
						}
						const t = e.options || {}
						return {
							type: e.type,
							options: {
								basePoint: t.basePoint || { x: 0, y: 0, z: 0 },
								height: t.hasOwnProperty("height") ? t.height : 1 / 0,
								radius: t.hasOwnProperty("radius") ? t.radius : 1 / 0
							}
						}
					}
					create(e) {
						const t = new CylinderSource(this.sourceType, new this.cylinderVolumeFactory(), this.THREE),
							o = t.volume
						return (
							o.updateBasePoint(e.options.basePoint),
							o.updateHeight(e.options.height),
							o.updateRadius(e.options.radius),
							t
						)
					}
				}
				class UpdateSourceExecutor {
					constructor(e) {
						this.sourceUpdaters = e
					}
					validateInput(e, t) {
						if (!ae(e.sourceId) || !t.has(e.sourceId))
							throw Error("dev error: this should not occur unless the sdk was not setup properly")
						const o = t.get(e.sourceId)
						return this.sourceUpdaters[o.type].validateInput(e)
					}
					exec(e, t, o) {
						const n = o.get(e.sourceId)
						this.sourceUpdaters[n.type].update(e, n), t.return()
					}
				}
				class SphereSourceUpdater {
					validateInput(e) {
						if (!ve(e.options)) throw Error("Source.Sphere.update: invalid options provided to .update")
						if (!j(e.options.origin))
							throw Error(
								`Source.Sphere.update: 'origin' was specified but was not a valid Vector3; got ${e.options.origin}`
							)
						if (!q(e.options.radius) || e.options.radius < 0)
							throw Error(
								`Source.Sphere.update: 'radius' was specified but was not a positive number or Infinity; got ${e.options.radius}`
							)
						return e
					}
					update(e, t) {
						const o = t.volume
						o.updateOrigin(e.options.origin), o.updateRadius(e.options.radius), o.notify()
					}
				}
				class BoxSourceUpdater {
					validateInput(e) {
						if (!ve(e.options)) throw Error("Source.Box.update: invalid options provided to .update")
						if (e.options.center && !j(e.options.center))
							throw Error(
								`Source.Box.update: 'center' was specified but was not a valid Vector3; got ${e.options.center}`
							)
						if (
							e.options.size &&
							!(j(e.options.size) && e.options.size.x < 0 && e.options.size.y < 0 && e.options.size.z < 0)
						)
							throw Error(`Source.Box.update: 'size' was specified but was not a valid Vector3; got ${e.options.size}`)
						if (e.options.orientation && !be(e.options.orientation))
							throw Error(
								`Source.Box.update: 'orientation' was specified but was not a valid Orientation; got ${e.options.orientation}`
							)
						return e
					}
					update(e, t) {
						const o = t.volume
						o.updateCenter(e.options.center),
							o.updateDimensions(e.options.size),
							t.updateOrientation(e.options.orientation),
							o.notify()
					}
				}
				class CylinderSourceUpdater {
					validateInput(e) {
						if (!ve(e.options)) throw Error("Source.Cylinder.update: invalid options provided to .update")
						if (e.options.basePoint && !j(e.options.basePoint))
							throw Error(
								`Source.Cylinder.update: 'basePoint' was specified but was not a valid Vector3; got ${e.options.basePoint}`
							)
						if (e.options.hasOwnProperty("height") && !q(e.options.height))
							throw Error(
								`Source.Cylinder.update: 'height' was specified but was not a positive number or Infinity; got ${e.options.height}`
							)
						if (e.options.hasOwnProperty("radius") && !q(e.options.radius))
							throw Error(
								`Source.Cylinder: 'radius' was specified but was not a positive number or Infinity; got ${e.options.radius}`
							)
						return e
					}
					update(e, t) {
						const o = t.volume
						o.updateBasePoint(e.options.basePoint),
							o.updateHeight(e.options.height),
							o.updateRadius(e.options.radius),
							o.notify()
					}
				}
				function De(e, t, o) {
					const n = new Map(),
						r = new Map()
					return function (a, s) {
						!(function (e, t, o, n) {
							const r = new Map(),
								a = SdkCommand.create(new DependencyFetcher(t, o), new ClassFactory(SensorAddSourceExecutor)),
								s = SdkCommand.create(new DependencyFetcher(t, r), new ClassFactory(DisposeSensorExecutor)),
								i = SdkCommand.create(DependencyFetcher.extend(n, t), new ClassFactory(SensorShowDebugExecutor))
							e.addCommand("Sensor.addSource", a),
								e.addCommand("sensor.dispose", s),
								e.addCommand("sensor.showDebug", i)
							const d = { [ye.CAMERA]: new CameraSensorFactory() },
								c = SdkCommand.create(DependencyFetcher.extend(n, t, r), new ClassFactory(CreateSensorExecutor, e, d))
							e.addCommandToInterface(Object.assign({}, Se), c),
								e.addEnumToInterface({ namespace: "Sensor", name: "SensorType", values: ye })
						})(a, n, r, s),
							(function (e, t, o, n, r) {
								const a = new DependencyFetcher(t),
									s = {
										[n.SPHERE]: new SphereSourceUpdater(),
										[n.BOX]: new BoxSourceUpdater(),
										[n.CYLINDER]: new CylinderSourceUpdater()
									},
									i = SdkCommand.create(a, new ClassFactory(UpdateSourceExecutor, s))
								e.addCommand("Sensor.updateSource", i)
								const d = {
										[Ie.SPHERE]: new SphereSourceFactory(n, r.sphere, o),
										[Ie.BOX]: new BoxSourceFactory(n, r.box, o),
										[Ie.CYLINDER]: new CylinderSourceFactory(n, r.cylinder, o)
									},
									c = SdkCommand.create(a, new ClassFactory(CreateSourceExecutor, d))
								e.addCommandToInterface(Object.assign({}, Te), c),
									e.addEnumToInterface({ namespace: "Sensor", name: "SourceType", values: Ie })
							})(a, r, e, t, o)
					}
				}
				var Oe, Ae, Ne
				!(function (e) {
					e.FPS = "stat.fps"
				})(Oe || (Oe = {}))
				class FpsCalculator {
					constructor(e, t) {
						;(this.perfStatInterval = 1e3),
							(this.elapsedTime = 0),
							(this.frameCount = 0),
							(this.lastCalcTime = 0),
							(this.fps = [0]),
							(this.waitForUpdate = e),
							(this.perfStatInterval = t.tryGetProperty("perfInterval", this.perfStatInterval))
					}
					async calcAndBroadcast(e) {
						await this.waitForUpdate()
						const t = Date.now(),
							o = t - this.lastCalcTime
						;(this.lastCalcTime = t),
							(this.elapsedTime += o),
							this.frameCount++,
							this.elapsedTime >= this.perfStatInterval &&
								((this.fps[0] = (1e3 * this.frameCount) / this.elapsedTime),
								(this.elapsedTime = 0),
								(this.frameCount = 0),
								e.broadcast(Oe.FPS, () => this.fps)),
							this.calcAndBroadcast(e)
					}
				}
				!(function (e) {
					;(e.ALIGNED = "aligned"), (e.UNALIGNED = "unaligned")
				})(Ae || (Ae = {})),
					(function (e) {
						;(e.UNPLACED = "unplaced"), (e.AUTO = "auto"), (e.MANUAL = "manual")
					})(Ne || (Ne = {}))
				class SweepPlacementConverter {
					constructor(e, t) {
						;(this.toSdkAlignmentMap = { [e.ALIGNED]: Ae.ALIGNED, [e.UNALIGNED]: Ae.UNALIGNED }),
							(this.toSdkPlacementMap = { [t.UNPLACED]: Ne.UNPLACED, [t.AUTO]: Ne.AUTO, [t.MANUAL]: Ne.MANUAL })
					}
					toSdkAlignment(e) {
						return this.toSdkAlignmentMap[e]
					}
					toSdkPlacement(e) {
						return this.toSdkPlacementMap[e]
					}
				}
				const Me = Object.freeze({
					signedUrlDefaultExpireTime: 24e4,
					signedUrlCheckInterval: 1e4,
					signedUrlRefreshBuffer: 15e3,
					visionTilingStartDate: new Date("8/26/2016"),
					visionTilingStartVersion: "1.1.407.13667",
					epsilon: 1e-5,
					skyboxMeshGroup: "_group_skybox_",
					skysphereMeshGroup: "_group_skysphere_"
				})
				class CurrentSweepSubFactory {
					constructor() {
						;(this.currentSweep = ""),
							(this.sweepTransitionActive = !1),
							(this.currentMode = null),
							(this.modeTransitionActive = !1)
					}
					create(e, t, o) {
						return new AggregateSubscription(
							t.onChanged(() => this.throttleSweepDataChanges(e, t)),
							o.onChanged(() => this.throttleViewmodeDataChanges(e, o))
						)
					}
					throttleSweepDataChanges(e, t) {
						const o = t.currentSweep || "",
							n = t.transition.active && t.transition.to !== t.transition.from
						;(this.currentSweep === o && this.sweepTransitionActive === n) ||
							((this.currentSweep = o), (this.sweepTransitionActive = n), e.onChanged())
					}
					throttleViewmodeDataChanges(e, t) {
						const o = t.currentMode,
							n = t.transition.active
						;(this.currentMode === o && this.modeTransitionActive === n) ||
							((this.currentMode = o), (this.modeTransitionActive = n), e.onChanged())
					}
				}
				class CurrentSweepObservable {
					constructor(e, t) {
						;(this.currentSweep = Object.assign(Object.assign({}, CurrentSweepObservable.empty), {
							floorInfo: Object.assign({}, CurrentSweepObservable.empty.floorInfo),
							neighbors: [],
							position: Object.assign({}, CurrentSweepObservable.empty.position),
							rotation: Object.assign({}, CurrentSweepObservable.empty.rotation)
						})),
							(this.Viewmode = e.Viewmode),
							(this.sweepPlacementConverter = t.sweepPlacementConverter)
					}
					get data() {
						return this.currentSweep
					}
					equals(e) {
						const t = Me.epsilon
						return (
							this.currentSweep.id === e.data.id &&
							this.currentSweep.enabled === e.data.enabled &&
							this.currentSweep.alignmentType === e.data.alignmentType &&
							this.currentSweep.placementType === e.data.placementType &&
							this.currentSweep.floorInfo.id === e.data.floorInfo.id &&
							this.currentSweep.floorInfo.sequence === e.data.floorInfo.sequence &&
							this.compareNeighbors(e.currentSweep) &&
							I(this.currentSweep.position, e.data.position, t) &&
							I(this.currentSweep.rotation, e.data.rotation, t)
						)
					}
					copy(e) {
						this.copySweep(e.data)
					}
					update(e, t, o, n, r) {
						const a = e.currentSweepObject
						if (
							!a ||
							e.transition.active ||
							t.transition.active ||
							(!t.isInside() && t.currentMode !== this.Viewmode.Outdoor)
						)
							return void this.copySweep(CurrentSweepObservable.empty)
						let s
						try {
							s = o.getFloor(a.floorId || "")
						} catch (e) {
							s = { id: void 0, index: void 0 }
						}
						const i = n.getIdForSweep(a)
						;(this.currentSweep.uuid = a.uuid),
							(this.currentSweep.sid = i),
							(this.currentSweep.id = i),
							(this.currentSweep.enabled = a.enabled),
							(this.currentSweep.alignmentType = this.sweepPlacementConverter.toSdkAlignment(a.alignmentType)),
							(this.currentSweep.placementType = this.sweepPlacementConverter.toSdkPlacement(a.placementType)),
							(this.currentSweep.neighbors = [...a.neighbours]),
							y(this.currentSweep.position, a.position),
							y(this.currentSweep.rotation, a.rotation),
							this.currentSweep.alignmentType === Ae.UNALIGNED && this.currentSweep.placementType === Ne.UNPLACED
								? ((this.currentSweep.floorInfo.id = void 0), (this.currentSweep.floorInfo.sequence = void 0))
								: ((this.currentSweep.floorInfo.id = s.id ? r.getIdFromCwfId(s.id) : s.id),
								  (this.currentSweep.floorInfo.sequence = s.index))
					}
					copySweep(e) {
						;(this.currentSweep.uuid = e.uuid),
							(this.currentSweep.sid = e.sid),
							(this.currentSweep.id = e.id),
							(this.currentSweep.enabled = e.enabled),
							(this.currentSweep.alignmentType = e.alignmentType),
							(this.currentSweep.placementType = e.placementType),
							(this.currentSweep.floorInfo.id = e.floorInfo.id),
							(this.currentSweep.floorInfo.sequence = e.floorInfo.sequence),
							(this.currentSweep.neighbors = [...e.neighbors]),
							y(this.currentSweep.position, e.position),
							y(this.currentSweep.rotation, e.rotation)
					}
					compareNeighbors(e) {
						const t = this.currentSweep.neighbors.length
						for (let o = 0; o < t; ++o) if (this.currentSweep.neighbors[o] !== e.neighbors[o]) return !1
						return t === e.neighbors.length
					}
				}
				var xe, Fe
				;(CurrentSweepObservable.empty = {
					uuid: "",
					sid: "",
					id: "",
					enabled: !1,
					alignmentType: Ae.ALIGNED,
					placementType: Ne.UNPLACED,
					floorInfo: { id: void 0, sequence: void 0 },
					neighbors: [],
					position: { x: 0, y: 0, z: 0 },
					rotation: { x: 0, y: 0, z: 0 }
				}),
					(function (e) {
						;(e.ENTER = "sweep.enter"), (e.EXIT = "sweep.exit")
					})(xe || (xe = {}))
				class MoveToSweepExecutor {
					constructor(e, t) {
						;(this.NavigateToSweepCommand = e.NavigateToSweepCommand),
							(this.issueCommand = t.issueCommand),
							(this.cameraTransitionConverter = t.cameraTransitionConverter),
							(this.conversion = t.conversionUtils)
					}
					validateInputSweepId(e, t, o) {
						if (!e || !ae(e)) throw Error(`Sweep.moveTo: 'sweep' was not a valid sweep id; got ${e}`)
						const n = o.getSweepForId(e)
						if (!n) throw Error(e + " does not map to a valid sweep in this model")
						return n.id
					}
					validateInput(e, t, o) {
						const n = this.validateInputSweepId(e.sweep, t, o),
							a = e.options || {}
						if (
							a.rotation &&
							!(function (e) {
								const t = e
								return !!t && !("z" in t && !q(t.z)) && q(t.x) && q(t.y)
							})(a.rotation)
						)
							throw Error(
								`Sweep.moveTo: 'options.rotation' was specified but was not a valid Rotation; got ${a.rotation}`
							)
						if (a.transition && !f(r, a.transition))
							throw Error(
								`Sweep.moveTo: options.transition was specified but was not a valid transition type; got ${a.transition}`
							)
						if (a.transitionTime && (!q(a.transitionTime) || a.transitionTime <= 0))
							throw Error(
								`Sweep.moveTo: options.transitionTime was specified but was not a valid, positive time; got ${a.transitionTime}`
							)
						return {
							sweep: n,
							options: { rotation: a.rotation, transition: a.transition, transitionTime: a.transitionTime || void 0 }
						}
					}
					async exec(e, t, o) {
						const n = e.options.rotation ? this.conversion.rotationToQuaternion(e.options.rotation) : void 0,
							r = e.options.transition,
							a = e.options.transition ? this.cameraTransitionConverter.fromSdkTransition(r) : void 0,
							s = e.options.transitionTime,
							i = await this.issueCommand(
								new this.NavigateToSweepCommand({ sweep: e.sweep, rotation: n, transition: a, transitionTime: s })
							)
						t.return(i)
					}
				}
				class SweepSubFactory {
					create(e, t) {
						return t.onChanged(() => e.onChanged())
					}
				}
				class SweepDataCollection {
					constructor(e, t) {
						;(this._data = {}), (this.conversionUtils = e), (this.sweepPlacementConverter = t)
					}
					get data() {
						return this._data
					}
					isItemEqual(e, t) {
						return !p(this.data[t], e.data[t])
					}
					update(e, t, o, n) {
						for (const r of e.sweeps()) {
							const { id: e, index: a } = r.floorId ? t.getFloor(r.floorId) : { id: "", index: -1 },
								s = e ? n.getIdFromCwfId(e) : void 0,
								i = o.getIdFromCwfId(r.id),
								d = this.data[i] || {}
							;(d.uuid = r.uuid),
								(d.sid = i),
								(d.id = i),
								(d.enabled = r.enabled),
								(d.alignmentType = this.sweepPlacementConverter.toSdkAlignment(r.alignmentType)),
								(d.neighbors = r.neighbours.map(e => o.getIdFromCwfId(e))),
								(d.position = Re(r, d.position)),
								(d.rotation = this.conversionUtils.quaternionToRotation(r.rotation, d.rotation)),
								(d.floorInfo = s ? { id: s, sequence: a } : { id: "", sequence: -1 }),
								(this.data[d.id] = d)
						}
						for (const e in this.data) {
							o.getSweepForId(e) || delete this.data[e]
						}
					}
					clear() {
						this._data = {}
					}
				}
				function Re(e, t) {
					return ((t = t || {}).x = e.position.x), (t.y = e.position.y), (t.z = e.position.z), t
				}
				class EnableExecutor {
					validateInput(e, t, o, n) {
						return { sweepIds: Pe(e.sweepIds, t, n) }
					}
					exec(e, t, o, n) {
						for (const t of e.sweepIds) _e(t, !0, o, n)
						t.return()
					}
				}
				class DisableExecutor {
					validateInput(e, t, o, n) {
						return { sweepIds: Pe(e.sweepIds, t, n) }
					}
					exec(e, t, o, n) {
						for (const t of e.sweepIds) _e(t, !1, o, n)
						t.return()
					}
				}
				function Pe(e, t, o) {
					if (!Array.isArray(e)) throw Error()
					return e.map(e =>
						(function (e, t, o) {
							if (!ae(e)) throw Error(e + " is not a valid string input")
							const n = o.getSweepForId(e)
							if (!n) throw Error(e + " does not map to a valid sweep in this model")
							return n.id
						})(e, 0, o)
					)
				}
				function _e(e, t, o, n) {
					n.setVisible(e, t)
					const r = o.getSweep(e)
					;(r.enabled = t), r.commit()
				}
				!(function (e) {
					;(e.STARTED = "tour.started"),
						(e.STOPPED = "tour.stopped"),
						(e.ENDED = "tour.ended"),
						(e.STEPPED = "tour.stepped")
				})(Fe || (Fe = {}))
				const Le = new Logger("sdk: tours")
				class TourStartExecutor {
					validateInput(e) {
						return (
							void 0 !== e.index && isNaN(e.index) && (Le.warn(e.index, "is not a valid number"), (e.index = void 0)),
							void 0 !== e.steps && isNaN(e.steps) && (Le.warn(e.steps, "is not a valid number"), (e.steps = void 0)),
							e
						)
					}
					exec(e, t, o, n) {
						if (0 === n.getSnapshotCount()) throw Error("No tour data found")
						if (!o.canChangeTourLocation())
							throw Error("TourStart ignored, cannot change location at this time, another transition is active")
						try {
							o.startTour(e.index, e.steps, e.loop), t.return()
						} catch (e) {
							t.throw(`Error occurred while starting tour - ${e}`)
						}
					}
				}
				class TourStopExecutor {
					validateInput(e) {
						return e
					}
					exec(e, t, o) {
						o.stopTour()
							.then(() => t.return())
							.catch(e => {
								t.throw(`Error occurred while stopping tour - ${e}`)
							})
					}
				}
				class TourStepExecutor {
					validateInput(e, t, o) {
						const n = e.index
						if (!q(n)) throw Error(n + " is not a valid tour snapshot index")
						if (n < 0 || n > o.getSnapshotCount())
							throw Error(`${n} is outside of the range of tour snapshots: [0 , ${o.getSnapshotCount() - 1}]`)
						return { index: n }
					}
					exec(e, t, o, n) {
						if (0 === n.getSnapshotCount()) throw Error("No tour data found")
						if (!o.canChangeTourLocation())
							throw Error("TourStep ignored, cannot change location at this time, another transition is active")
						o.tourGoTo(e.index)
							.then(() => t.return())
							.catch(e => {
								t.throw(`Error occurred while jumping to new tour location - ${e}`)
							})
					}
				}
				class TourStepRelativeExecutor {
					constructor(e) {
						this.forward = e
					}
					validateInput(e) {
						return e
					}
					exec(e, t, o, n) {
						if (0 === n.getSnapshotCount()) throw Error("No tour data found")
						if (!o.canChangeTourLocation())
							throw Error("TourStep ignored, cannot change location at this time, another transition is active")
						;(this.forward ? o.tourGoNext(!1) : o.tourGoPrevious(!1))
							.then(() => t.return())
							.catch(e => {
								t.throw(`Error while trying to travel to the next tour snapshot - ${e}`)
							})
					}
				}
				function ke(e, t, o, n) {
					!(function (e, t, o) {
						t.addBinding(GetTourDataCommand, async () =>
							o.getDependencies().then(async ([o, n]) => {
								const r = await Promise.all(
									n.getEnabledSnapshots().map(o =>
										(async function (e, t, o) {
											let n = o.viewmodeConverter.toSdk(e.metadata.cameraMode)
											if (!n || n === o.commandModeConverter.toSdk(t.CommandViewmode.TRANSITIONING))
												throw Error("Failed to convert snapshot, invalid viewmode")
											n === o.commandModeConverter.toSdk(t.CommandViewmode.INSIDE) &&
												e.is360 &&
												(n = o.commandModeConverter.toSdk(t.CommandViewmode.OUTSIDE))
											return {
												sid: e.sid,
												thumbnailUrl: await e.thumbnailUrl.get(),
												imageUrl: await e.imageUrl.get(),
												is360: e.is360,
												name: e.name,
												mode: n,
												zoom: e.metadata.ssZoom,
												position: e.metadata.cameraPosition,
												rotation: o.conversionUtils.quaternionToRotation(e.metadata.cameraQuaternion)
											}
										})(o, e, t)
									)
								)
								if (0 === r.length) throw Error("No tour data found")
								return r
							})
						)
					})(t, o, n),
						e.addCommandCreator({ namespace: "Tour", name: "getData", args: [] }, () => new GetTourDataCommand())
					const r = n,
						a = SdkCommand.create(r, new ClassFactory(TourStartExecutor)),
						s = SdkCommand.create(r, new ClassFactory(TourStopExecutor)),
						i = SdkCommand.create(r, new ClassFactory(TourStepExecutor)),
						d = SdkCommand.create(r, new ClassFactory(TourStepRelativeExecutor, !0)),
						c = SdkCommand.create(r, new ClassFactory(TourStepRelativeExecutor, !1))
					e.addCommandToInterface({ namespace: "Tour", name: "start", args: ["index"] }, a),
						e.addCommandToInterface({ namespace: "Tour", name: "stop", args: [] }, s),
						e.addCommandToInterface({ namespace: "Tour", name: "step", args: ["index"] }, i),
						e.addCommandToInterface({ namespace: "Tour", name: "prev", args: [] }, d),
						e.addCommandToInterface({ namespace: "Tour", name: "next", args: [] }, c)
				}
				class GetTourDataCommand extends Command {
					constructor() {
						super(...arguments), (this.id = "GET_TOUR_DATA")
					}
				}
				function Ge(o, n, c, u, p, h = {}) {
					const { THREE: g } = n,
						{
							appPhaseModule: C,
							applicationData: y,
							cameraData: S,
							canvasData: T,
							floorData: I,
							floorViewData: v,
							labelData: b,
							mattertagData: D,
							mattertagViewData: O,
							measurementModeData: A,
							meshData: N,
							modelData: M,
							raycasterData: B,
							roomData: H,
							settingsData: j,
							sweepData: W,
							sweepViewData: K,
							tourData: J,
							viewmodeData: ee,
							commonControlsModule: te,
							floorCasterModule: ne,
							mattertagDataModule: re,
							mattertagMeshModule: ae,
							mattertagViewDataModule: se,
							modelDataModule: ge,
							modelMeshModule: ye,
							navigationModule: Se,
							renderToTextureModule: Te,
							sceneModule: Ie,
							sensorModule: Ee,
							settingsModule: ve,
							tourControlsModule: be,
							webglRendererModule: Me,
							zoomControlModule: Re,
							sweepTextureLoader: Pe
						} = p
					h.idOption = h.idOption || a.LEGACY
					const _e = new Conversion(g),
						Le = new ViewmodeConverter(c.Viewmode),
						Ge = (function (e) {
							return async function (t, o) {
								const n = o.rotationSpeed
								let r = 0
								const a = Math.abs(o.xAngle),
									s = Math.abs(o.yAngle),
									i = Math.max(a, s)
								if (i >= Math.PI) {
									const e = i / Math.PI,
										t = Math.floor(e),
										o = a / e,
										n = s / e,
										d = a - o * t,
										c = s - n * t
									r = Math.acos(Math.cos(o) * Math.cos(n)) * t + Math.acos(Math.cos(d) * Math.cos(c))
								} else r = Math.acos(Math.cos(Math.abs(o.xAngle)) * Math.cos(Math.abs(o.yAngle)))
								if (r) {
									const a = new e.Vector2(-o.xAngle, o.yAngle)
									return a.multiplyScalar(n / r), t.startRotateTransition(r / n, a, !1)
								}
							}
						})(g),
						Ve = new SweepPlacementConverter(c.SweepAlignmentType, c.SweepPlacementType),
						Ue = (async function () {
							const e = await W
							return h.idOption === a.LEGACY ? new LegacySweepIdMap(e) : new SweepIdMap(e)
						})(),
						ze = (async function () {
							const e = await I
							return h.idOption === a.LEGACY ? new LegacyFloorIdMap(e) : new FloorIdMap(e)
						})(),
						Be = (async function () {
							const e = await H
							return h.idOption === a.LEGACY ? new LegacyRoomIdMap(e) : new RoomIdMap(e)
						})(),
						qe = Object.assign(Object.assign({}, u), {
							conversionUtils: new Conversion(g),
							directionConverter: new DirectionConverter(c.Vectors),
							getPose: x(g, Le),
							rotateCamera: Ge,
							orientCamera: E(g, c.Viewmode, Ge),
							appPhaseConverter: new AppPhaseConverter(c.AppPhase),
							applicationConverter: new ApplicationConverter(c.Application),
							mediaConverter: new MediaConverter(c.MattertagMediaType, c.TagDescriptionChunkType),
							chunkTypeConverter: new ChunkTypeConverter(c.TagDescriptionChunkType),
							linkTypeConverter: new LinkTypeConverter(c.TagLinkType),
							sweepPlacementConverter: Ve,
							viewmodeConverter: Le,
							commandModeConverter: new CommandModeConverter(c.CommandViewmode),
							cameraTransitionConverter: new CameraTransitionConverter(c.CameraTransitionType),
							makeLabelData: V(g, u.worldToScreenPosition),
							makeModelData: le(_e, Ve),
							sweepUtils: new SweepUtils(c.SweepAlignmentType)
						})
					var He
					;(He = o).addEnumToInterface({ namespace: "App", name: "Phase", values: d }),
						He.addEnumToInterface({ namespace: "App", name: "Event", values: s }),
						He.addEnumToInterface({ namespace: "App", name: "Application", values: i }),
						(function (e, t, o) {
							const n = [void 0],
								r = e => ((n[0] = o.appPhaseConverter.toSdkAppPhase(e.phase)), n)
							o.subscribe(t.AppPhaseChangeMessage, t => {
								e.broadcast(s.PHASE_CHANGE, r, t)
							})
						})(o, c, qe),
						(function (e, t, o) {
							o.getDependencies().then(([e]) => {
								t.addBinding(GetAppStateCommand, async () => {
									try {
										const o = e.getData()
										return {
											phase: t.appPhaseConverter.toSdkAppPhase(o.phase),
											application: t.applicationConverter.toSdkApplication(o.application)
										}
									} catch (e) {
										throw Error("Error: Can't get application data at this time")
									}
								})
							}),
								e.addCommandCreator({ namespace: "App", name: "getState", args: [] }, () => new GetAppStateCommand())
						})(o, qe, new DependencyFetcher(C)),
						(function (e, t, o) {
							t.addBinding(GetAppPhaseTimesCommand, async () => {
								const e = {
										[d.WAITING]: null,
										[d.LOADING]: null,
										[d.STARTING]: null,
										[d.PLAYING]: null,
										[d.ERROR]: null
									},
									[n] = await o.getDependencies()
								for (const o in n.phaseTimes) {
									const r = Number(o)
									e[t.appPhaseConverter.toSdkAppPhase(r)] = n.phaseTimes[r]
								}
								return e
							}),
								e.addCommandCreator(
									{ namespace: "App", name: "getLoadTimes", args: [] },
									() => new GetAppPhaseTimesCommand()
								)
						})(o, qe, new DependencyFetcher(y)),
						(function (e, t, o, n) {
							const r = SdkObservable.create(n, new AppStateSubFactory(), new ClassFactory(AppStateObservable, t, o))
							e.addObservableToInterface({ namespace: "App", name: "state" }, r)
						})(o, c, qe, new DependencyFetcher(y)),
						(function (e, o, n) {
							n.getDependencies().then(([e, n, r, a]) => {
								const s = {
									position: { x: 0, y: 0, z: 0 },
									rotation: { x: 0, y: 0 },
									projection: new Float32Array(16),
									sweep: "",
									mode: t.TRANSITIONING
								}
								o.addBinding(GetPoseCommand, async () => o.getPose(s, e, n, r, a))
							}),
								e.addCommandCreator({ namespace: "Camera", name: "getPose", args: [] }, () => new GetPoseCommand())
						})(o, qe, new DependencyFetcher(S, W, ee, Ue)),
						(function (e, t, o, n) {
							n.getDependencies().then(([e, n, r]) => {
								o.addBinding(LookAtScreenCoordsCommand, async function (a = {}) {
									if (!r.isInside()) throw Error("Camera.lookAtScreenCoords must be called from Inside mode")
									const s = o.screenPositionToNDC(a.x, a.y, n.width, n.height),
										i = new t.Vector3(0, 0, -1).applyQuaternion(n.pose.rotation),
										d = o.ndcToWorldPosition(n, new t.Vector2(s.x, s.y), 1).normalize(),
										c = i.clone().setY(0).angleTo(d.clone().setY(0)),
										u = Math.asin(d.y - i.y),
										p = c * Math.sign(s.x),
										l = u
									return o.rotateCamera(e, { xAngle: p, yAngle: l, zAngle: 0, rotationSpeed: m })
								})
							}),
								e.addCommandCreator({ namespace: "Camera", name: "lookAtScreenCoords", args: ["x", "y"] }, function (
									e = {}
								) {
									if (((e.x = e.x || 0), (e.y = e.y || 0), isNaN(e.x) || isNaN(e.y)))
										throw new Error(`${JSON.stringify(e)} does not contain valid screen coordinates`)
									return new LookAtScreenCoordsCommand({ x: e.x, y: e.y })
								})
						})(o, g, qe, new DependencyFetcher(te, S, ee)),
						(function (e, o, n) {
							n.getDependencies().then(([n, r, a, s]) => {
								const i = [
										{
											position: { x: 0, y: 0, z: 0 },
											rotation: { x: 0, y: 0 },
											projection: new Float32Array(16),
											sweep: "",
											mode: t.TRANSITIONING
										}
									],
									d = (() => {
										let t = 0,
											c = !1
										const u = () => (o.getPose(i[0], n, r, a, s), i)
										return () => {
											const o = Date.now(),
												n = t + 100
											if (o > n) {
												;(c = !1), (t = o)
												try {
													e.broadcast(l.MOVE, u)
												} catch (e) {
													w.debug(
														"failed to broadcast pose, one of the module dependencies are probably not loaded yet"
													)
												}
											} else c || (setTimeout(() => d(), n - o), (c = !0))
										}
									})()
								n.onChanged(d), a.onChanged(d)
							}),
								e.addEnumToInterface({ namespace: "Camera", name: "Event", values: l })
						})(o, qe, new DependencyFetcher(S, W, ee, Ue)),
						(function (t, o, n) {
							n.getDependencies().then(([t]) =>
								o.addBinding(MoveDirectionCommand, async n => {
									const r = n.direction
									if (!f(e, n.direction)) throw new Error(`${n.direction} is not a valid direction`)
									await t.navigateInLocalDirection(o.directionConverter.toVector(r))
								})
							),
								t.addEnumToInterface({ namespace: "Camera", name: "Direction", values: e }),
								t.addCommandCreator(
									{ namespace: "Camera", name: "moveInDirection", args: ["direction"] },
									e => new MoveDirectionCommand(e || {})
								)
						})(o, qe, new DependencyFetcher(Se)),
						(function (e, t, o, n) {
							n.getDependencies().then(([e, n]) => {
								o.addBinding(PanCommand, async o => {
									const r = n.pose.position,
										a = o.x - r.x,
										s = o.z - r.z,
										i = new t.Vector2(a, s),
										d = i.length()
									i.setLength(0.005), await e.startTranslateTransition(d / 0.005, i, !1)
								})
							}),
								e.addCommandCreator({ namespace: "Camera", name: "pan", args: ["position"] }, e => {
									if (
										(((e = e || {}).position = e.position || {}),
										(e.position.x = e.position.x - 0),
										(e.position.z = e.position.z - 0),
										isNaN(e.position.x) || isNaN(e.position.z))
									)
										throw new Error(`${JSON.stringify(e)} does not contain a valid position to pan`)
									return new PanCommand({ x: e.position.x, z: e.position.z })
								})
						})(o, g, qe, new DependencyFetcher(te, S)),
						(function (e, t, o, n) {
							const r = SdkObservable.create(
								n,
								new PoseSubFactory(),
								new ClassFactory(ObservablePose, t, o.viewmodeConverter)
							)
							e.addObservableToInterface({ namespace: "Camera", name: "pose" }, r)
						})(o, g, qe, new DependencyFetcher(S, W, ee, Ue)),
						(function (e, t, o, n) {
							const r = t.MathUtils.degToRad(80) / 1e3
							n.getDependencies().then(([e, t, n]) => {
								o.addBinding(RotateCommand, async t => await o.rotateCamera(e, t)),
									o.addBinding(SetOrientationCommand, async r => await o.orientCamera(t, e, n, r))
							})
							const a = e => {
								const o = (e = e || {}).options || {},
									n = t.MathUtils.degToRad(e.xAngle || 0),
									a = t.MathUtils.degToRad(e.yAngle || 0),
									s = t.MathUtils.degToRad(e.zAngle || 0)
								let i = r
								if (o.speed) {
									if (isNaN(o.speed) || o.speed <= 0)
										throw new Error(`${JSON.stringify(o)} does not contain valid rotation speed`)
									i = t.MathUtils.degToRad(o.speed) / 1e3
								}
								if (isNaN(n) || isNaN(a) || isNaN(s))
									throw new Error(`${JSON.stringify(e)} does not contain valid rotation angles`)
								return { xAngle: n, yAngle: a, zAngle: s, rotationSpeed: i }
							}
							e.addCommandCreator(
								{ namespace: "Camera", name: "rotate", args: ["xAngle", "yAngle", "options"] },
								e => new RotateCommand(a(e))
							),
								e.addCommandCreator({ namespace: "Camera", name: "setRotation", args: ["rotation", "options"] }, e => {
									const t = (e = e || {}).rotation || {}
									return new SetOrientationCommand(a({ xAngle: t.x, yAngle: t.y, zAngle: t.z, options: e.options }))
								})
						})(o, g, qe, new DependencyFetcher(te, S, ee)),
						(function (e, t, o, n) {
							const r = n,
								a = SdkCommand.create(r, new ClassFactory(ZoomToExecutor, t, o)),
								s = SdkCommand.create(r, new ClassFactory(ZoomByExecutor, t, o)),
								i = SdkCommand.create(r, new ClassFactory(ZoomResetExecutor, t, o))
							e.addCommandToInterface({ namespace: "Camera", name: "zoomTo", args: ["zoomPct"] }, a),
								e.addCommandToInterface({ namespace: "Camera", name: "zoomBy", args: ["zoomDelta"] }, s),
								e.addCommandToInterface({ namespace: "Camera", name: "zoomReset", args: [] }, i)
						})(o, c, qe, new DependencyFetcher(S, ee, Re)),
						(function (e, t, o) {
							const n = SdkObservable.create(o, new ZoomSubFactory(), new ClassFactory(ZoomObservableData, t))
							e.addObservableToInterface({ namespace: "Camera", name: "zoom" }, n)
						})(o, c, new DependencyFetcher(S, ee)),
						(function (e, t, o) {
							const n = SdkObservable.create(o, new FloorSubFactory(), new ClassFactory(CurrentFloorObservableData, t))
							e.addObservableToInterface({ namespace: "Floor", name: "current" }, n)
						})(o, c, new DependencyFetcher(v, W, S, ze)),
						(function (e, t, o, n) {
							e.addEnumToInterface({ namespace: "Floor", name: "Event", values: F }),
								n.getDependencies().then(([n]) => {
									const r = [-1, -1]
									function a(e) {
										if (n) {
											const t = e.to ? n.getFloor(e.to) : null,
												o = e.from ? n.getFloor(e.from) : null
											t && (r[0] = t.index), o && (r[1] = o.index)
										}
										return r
									}
									const s = [-1, ""]
									function i(e) {
										if (n) {
											const t = e.floorId ? n.getFloor(e.floorId) : null
											t && (s[0] = t.index)
										}
										return (s[1] = e.floorName), s
									}
									o.subscribe(t.StartMoveToFloorMessage, t => e.broadcast(F.CHANGE_START, a, t)),
										o.subscribe(t.EndMoveToFloorMessage, t => e.broadcast(F.CHANGE_END, i, t))
								})
						})(o, c, qe, new DependencyFetcher(I)),
						(function (e, t) {
							const o = SdkCollection.create(
								t,
								new collection_data_FloorSubFactory(),
								new ClassFactory(FloorDataCollection)
							)
							e.addCollectionToInterface({ namespace: "Floor", name: "data" }, o)
						})(o, new DependencyFetcher(I, ze)),
						(function (e, t, o) {
							t.addBinding(GetFloorsDataCommand, async () => {
								const [e] = await o.getDependencies()
								return R(e)
							}),
								e.addCommandCreator({ namespace: "Floor", name: "getData", args: [] }, () => new GetFloorsDataCommand())
						})(o, qe, new DependencyFetcher(v)),
						(function (e, t, o, n) {
							n.getDependencies().then(([e]) =>
								o.addBinding(ChangeFloorCommand, async n => {
									if ("number" != typeof n.floorIndex || n.floorIndex < 0)
										throw Error("floor index must be a non-negative number")
									try {
										const r = "boolean" == typeof n.moveCamera && !n.moveCamera,
											a = r ? 250 : void 0
										await o.issueCommand(new t.MoveToFloorIndexCommand(n.floorIndex, r, a))
										const s = e.currentFloor
										return s ? s.index : -1
									} catch (e) {
										throw Error(`Could not move to floor at index ${n.floorIndex}`)
									}
								})
							),
								e.addCommandCreator(
									{ namespace: "Floor", name: "moveTo", args: ["floorIndex", "moveCamera"] },
									e => new ChangeFloorCommand(e)
								)
						})(o, c, qe, new DependencyFetcher(v)),
						(function (e, t, o, n) {
							const r = SdkCommand.create(n, new ClassFactory(ShowAllFloorsExecutor, t, o))
							e.addCommandToInterface({ namespace: "Floor", name: "showAll", args: ["moveCamera"] }, r)
						})(o, c, qe, new DependencyFetcher(v)),
						(function (e, t, o) {
							t.addBinding(LabelGetCommand, async () => t.makeLabelData(...(await o.getDependencies()))),
								e.addCommandCreator({ namespace: "Label", name: "getData", args: [] }, () => new LabelGetCommand())
						})(o, qe, new DependencyFetcher(S, I, b, ze)),
						(function (e, t, o, n) {
							e.addEnumToInterface({ namespace: "Label", name: "Event", values: P }),
								n.getDependencies().then(([n, r, a, s, i]) => {
									const d = () => [o.makeLabelData(n, a, r, i)]
									n.onChanged(o => {
										s.currentMode === t.Viewmode.Floorplan && e.broadcast(P.POSITION_UPDATED, d, o)
									})
								})
						})(o, c, qe, new DependencyFetcher(S, b, I, ee, ze)),
						(function (e) {
							e.addEnumToInterface({ namespace: "Mattertag", name: "DescriptionChunkType", values: k }),
								e.addEnumToInterface({ namespace: "Mattertag", name: "Event", values: _ }),
								e.addEnumToInterface({ namespace: "Mattertag", name: "LinkType", values: G }),
								e.addEnumToInterface({ namespace: "Mattertag", name: "MediaType", values: L }),
								e.addEnumToInterface({ namespace: "Mattertag", name: "Transition", values: r })
						})(o),
						Y(o, g, c, qe, new DependencyFetcher(I, H, N, re)),
						(function (e, t, o, n) {
							o.addBinding(GetMattertagDataCommand, async () =>
								n.getDependencies().then(([e, t, n]) => {
									try {
										const r = []
										return (
											e.iterate(e => {
												const { id: a, index: s } = t.getFloor(e.floorId),
													i = n.getIdFromCwfId(a),
													d = e.mediaSrc,
													c = o.mediaConverter.fromTagChunkType(e.mediaType)
												r.push({
													sid: e.sid,
													label: e.label,
													description: e.description,
													parsedDescription: X(e.parsedDescription, o.chunkTypeConverter, o.linkTypeConverter),
													mediaSrc: d,
													mediaType: c,
													media: { type: c, src: d },
													anchorPosition: { x: e.anchorPosition.x, y: e.anchorPosition.y, z: e.anchorPosition.z },
													anchorNormal: { x: e.anchorNormal.x, y: e.anchorNormal.y, z: e.anchorNormal.z },
													color: { r: e.color.r, g: e.color.g, b: e.color.b },
													enabled: e.enabled,
													floorId: s,
													floorIndex: s,
													floorInfo: { id: i, sequence: s },
													stemVector: { x: e.stemVector.x, y: e.stemVector.y, z: e.stemVector.z },
													stemHeight: e.stemHeight,
													stemVisible: e.stemVisible
												})
											}),
											r
										)
									} catch (e) {
										throw Error("problem getting tag data")
									}
								})
							),
								e.addCommandCreator(
									{ namespace: "Mattertag", name: "getData", args: [] },
									() => new GetMattertagDataCommand()
								)
						})(o, 0, qe, new DependencyFetcher(D, I, ze)),
						(function (e, t, o, n) {
							const r = {},
								a = {}
							o.addBinding(RegisterIconCommand, async e => {
								const { iconId: n, iconSrc: s } = e
								if (!s || "string" != typeof s) throw Error("icon src is not a valid string")
								if (!n || "string" != typeof n) throw Error("icon id is not a valid string")
								if (a[n]) throw Error(n + " already has a registered icon")
								const i = new SvgLoader(new z.RequestQueue()),
									d = new Promise((e, r) => {
										const d = ".svg"
										if (s.indexOf(d, s.length - d.length) > -1)
											i.load(s).then(o => {
												const r = new t.Texture(o)
												;(r.needsUpdate = !0), (a[n] = r), e(r.image)
											})
										else {
											const t = o.loadImage(
												s,
												() => {
													;(a[n] = t), e(t.image)
												},
												() => {
													r("Failed to load " + s)
												}
											)
										}
									})
								r[n] = d
								try {
									await d
								} catch (e) {
									throw (delete r[n], Error(e))
								}
							}),
								o.addBinding(EditIconCommand, async e => {
									const [o, s] = await n.getDependencies(),
										{ iconId: i, tagId: d } = e
									if (!i || !r[i]) throw Error(i + " has not been registered as valid icon id")
									if (!U(d)) throw new TagIdInputException(d)
									if (!s.getTag(d)) throw Error(d + " is not a valid tag id")
									let c
									try {
										c = await r[i]
									} catch (e) {
										throw Error(e)
									}
									const u = a[i],
										p = c.naturalWidth / c.naturalHeight,
										m = new t.Vector3()
									p > 1 ? m.set(p, 1, 1) : m.set(1, 1 / p, 1), o.setOverrideMaterial(d, u, m)
								}),
								o.addBinding(ResetIconCommand, async e => {
									const [t] = await n.getDependencies(),
										{ tagId: o } = e
									t.setOverrideMaterial(o, null, null)
								}),
								e.addCommandCreator(
									{ namespace: "Mattertag", name: "registerIcon", args: ["iconId", "iconSrc"] },
									e => new RegisterIconCommand(e)
								),
								e.addCommandCreator(
									{ namespace: "Mattertag", name: "editIcon", args: ["tagId", "iconId"] },
									e => new EditIconCommand(e)
								),
								e.addCommandCreator(
									{ namespace: "Mattertag", name: "resetIcon", args: ["tagId"] },
									e => new ResetIconCommand(e)
								)
						})(o, g, qe, new DependencyFetcher(ae, D)),
						(function (e, t, o, n, r) {
							const a = {
								[L.NONE]: o.TagDescriptionChunkType.none,
								[L.PHOTO]: o.TagDescriptionChunkType.photo,
								[L.VIDEO]: o.TagDescriptionChunkType.video,
								[L.RICH]: o.TagDescriptionChunkType.rich
							}
							r.getDependencies().then(() => {
								n.addBinding(EditBillboardCommand, async e => {
									const t = e.tagId
									if (!U(t)) throw new TagIdInputException(t)
									if (!e.properties) return
									const r = e.properties[Q.LABEL],
										s = e.properties[Q.MEDIA],
										i = e.properties[Q.DESCRIPTION]
									if (null != r && "string" != typeof r)
										throw Error("Mattertag.editBillboard only accepts a string for the title field")
									if (null != i && "string" != typeof i)
										throw Error("Mattertag.editBillboard only accepts a string for the description field")
									if (null != s) {
										if ("string" != typeof s.src)
											throw Error("Mattertag.editBillboard only accepts a string for the media.src field")
										if (!f(L, s.type))
											throw Error(
												"Mattertag.editBillboard only accepts a value from Mattertag.MediaType for the media.type field"
											)
									}
									let d
									s && (d = { mediaType: a[s.type], mediaSrc: s.src })
									const c = { label: r, description: i }
									await n.issueCommand(new o.EditMattertagCommand(e.tagId, c, d))
								}),
									n.addBinding(EditColorCommand, async e => {
										const r = e.color
										if (null != r && !$(r))
											throw Error(
												"Mattertag.editColor only accepts a Color object of the form {r, g, b} for the color field"
											)
										const a = { color: new t.Color().setRGB(r.r, r.g, r.b) }
										await n.issueCommand(new o.EditMattertagCommand(e.tagId, a))
									})
							}),
								e.addCommandCreator(
									{ namespace: "Mattertag", name: "editBillboard", args: ["tag", "values"] },
									e => new EditBillboardCommand(e.tag, e.values)
								),
								e.addCommandCreator(
									{ namespace: "Mattertag", name: "editColor", args: ["tag", "color"] },
									e => new EditColorCommand(e.tag, e.color)
								)
						})(o, g, c, qe, new DependencyFetcher(D)),
						(function (e, t) {
							const o = SdkCommand.create(t, new ClassFactory(EditOpacityExecutor))
							e.addCommandToInterface({ namespace: "Mattertag", name: "editOpacity", args: ["sid", "opacity"] }, o)
						})(o, new DependencyFetcher(D, ae)),
						(function (e, t, o) {
							const n = SdkCollection.create(o, new MattertagSubFactory(), new ClassFactory(MattertagDataCollection, t))
							e.addCollectionToInterface({ namespace: "Mattertag", name: "data" }, n)
						})(o, qe, new DependencyFetcher(D, I, ze)),
						(function (e, t, o) {
							const n = SdkCommand.create(o, new ClassFactory(InjectionExecutor, t))
							e.addCommandToInterface(Object.assign({}, oe), n)
						})(
							o,
							function () {
								return "./sdk/mattertag/mattertag.postMessage.html"
							},
							new DependencyFetcher(D)
						),
						(function (e, t, o, n) {
							let r
							e.addCommandCreator({ namespace: "Mattertag", name: "editPosition", args: ["sid", "options"] }, e => {
								if (!r) throw Error("Edit command not bound yet")
								return r(e)
							})
							const a = new t.Vector3(),
								s = new t.Vector3()
							n.getDependencies().then(function ([e, t, n, i]) {
								r = ({ sid: r, options: d }) => {
									const { stemVector: c, anchorPosition: u } = d,
										p = {}
									if (!U(r)) throw new TagIdInputException(r)
									const m = e.getTag(r)
									if (!m) throw Error(`${r} was not found in the mattertag data`)
									if (u && (!q(u.x) || !q(u.y) || !q(u.z))) throw Error(`${u} is not a valid Vector3`)
									if (c && (!q(c.x) || !q(c.y) || !q(c.z))) throw Error(`${c} is not a valid Vector3`)
									let l = t.getFloor(m.floorId)
									s.copy(m.anchorPosition),
										a.copy(m.anchorNormal),
										c && (a.set(c.x, c.y, c.z), (p.stemHeight = a.length()), a.normalize()),
										u && (s.set(u.x, u.y, u.z), (l = t.getFloorAtIndex(Z(s, t, n, i))))
									const h = void 0 !== d.floorIndex ? d.floorIndex : d.floorId
									if ((void 0 !== h && (l = t.getFloorAtIndex(h)), !l))
										throw new Error(`Could not move Mattertag to invalid floor with index: ${h}`)
									return new o.EditMattertagCommand(r, p, void 0, { floorId: l.id, normal: a, position: s })
								}
							})
						})(o, g, c, new DependencyFetcher(D, I, H, N)),
						(function (e, t, o) {
							e.addCommandCreator(
								{ namespace: "Mattertag", name: "navigateToTag", args: ["sid", "transitionType"] },
								e => {
									const n = e.transitionType
										? o.cameraTransitionConverter.fromSdkTransition(e.transitionType)
										: t.CameraTransitionType.Interpolate
									return new MattertagNavigateCommand(e.sid, n)
								}
							),
								o.addBinding(MattertagNavigateCommand, async e => {
									try {
										return await o.issueCommand(new t.NavigateToMattertagCommand(e.sid, e.transition)), e.sid
									} catch (t) {
										throw Error(`Could not move to tag with sid ${e.sid}`)
									}
								})
						})(o, c, qe),
						(function (e, t) {
							const o = SdkCommand.create(t, new ClassFactory(PreventActionExecutor))
							e.addCommandToInterface({ namespace: "Mattertag", name: "preventAction", args: ["sid", "prevent"] }, o)
						})(o, new DependencyFetcher(O)),
						(function (e, t, o) {
							e.addCommandCreator({ namespace: "Mattertag", name: "remove", args: ["tags"] }, function (e) {
								const o = []
								if (!e.tags) throw Error("invalid list of tags to remove")
								if (Array.isArray(e.tags)) {
									const n = e.tags,
										r = n.length
									o.length = r
									for (let e = 0; e < r; ++e) o[e] = new t.RemoveMattertagCommand(n[e])
								} else o.push(new t.RemoveMattertagCommand(e.tags))
								return new BatchRemoveMattertagCommand(o)
							}),
								o.addBinding(BatchRemoveMattertagCommand, async e => {
									const t = [],
										n = e.removeCommands
									for (const e of n) {
										const n = await o.issueCommand(e)
										n && t.push(n)
									}
									return t
								})
						})(o, c, qe),
						(function (e, t, o, n) {
							n.getDependencies().then(([n]) => {
								const r = ["", !1],
									a = e => ((r[0] = e.id), (r[1] = e.hovering), r)
								o.subscribe(t.PinHoverChangeMessage, o => {
									o.pinType === t.PinType.MATTERTAG && e.broadcast(_.HOVER, a, o)
								})
								const s = [""],
									i = e => ((s[0] = e.id), s)
								o.subscribe(t.PinClickedMessage, o => {
									o.pinType === t.PinType.MATTERTAG && e.broadcast(_.CLICK, i, o)
								})
								const d = ["", ""],
									c = e => ((d[0] = n.openTag), (d[1] = e.url), d)
								o.subscribe(t.MattertagLinkOpenedMessage, t => {
									e.broadcast(_.LINK_OPEN, c, t)
								})
							})
						})(o, c, qe, new DependencyFetcher(O)),
						(function (e, t, o) {
							e.addCommandCreator(
								{ namespace: "Mattertag", name: "closeBillboards", args: ["tag"] },
								e => new MattertagCloseCommand(e.tag)
							),
								o.getDependencies().then(([e]) => {
									t.addBinding(MattertagOpenCommand, async t => {
										const o = t.tag
										if (!U(o)) throw new TagIdInputException(o)
										e.openBillboard(o)
									})
								}),
								o.getDependencies().then(([e]) => {
									t.addBinding(MattertagCloseCommand, async t => {
										const o = t.tag
										if (!U(o)) throw new TagIdInputException(o)
										e.closeBillboard(t.tag)
									})
								})
						})(o, qe, new DependencyFetcher(se)),
						(function (e, t, o) {
							t.addBinding(GetMeasurementsDataCommand, async () => {
								const [e, t] = await o.getDependencies()
								return ie(e, t)
							}),
								e.addCommandCreator(
									{ namespace: "Measurements", name: "getData", args: [] },
									() => new GetMeasurementsDataCommand()
								)
						})(o, qe, new DependencyFetcher(A, I)),
						(function (e, t, o) {
							const n = SdkCollection.create(
								o,
								new MeasurementModeSubFactory(t.MeasuringPhase),
								new ClassFactory(MeasurementDataCollection)
							)
							e.addCollectionToInterface({ namespace: "Measurements", name: "data" }, n)
						})(o, c, new DependencyFetcher(A)),
						(function (e, t) {
							const o = SdkObservable.create(
								t,
								new MeasurementPhaseSubFactory(),
								new ClassFactory(MeasurementModeObservable)
							)
							e.addObservableToInterface({ namespace: "Measurements", name: "mode" }, o)
						})(o, new DependencyFetcher(A)),
						(function (e, t, o) {
							o.addBinding(ToggleMeasureModeCommand, async e =>
								o.issueCommand(new t.ToggleToolCommand(t.Tools.MEASUREMENTS, e.active))
							),
								e.addCommandCreator(
									{ namespace: "Measurements", name: "toggleMode", args: ["active"] },
									e => new ToggleMeasureModeCommand(e.active)
								)
						})(o, c, qe),
						(function (e, t, o, n) {
							e.addEnumToInterface({ namespace: "Mode", name: "Event", values: de }),
								n.getDependencies().then(([n, r]) => {
									const a = [void 0, void 0],
										s = e => {
											const t = r.currentMode,
												s = o.sweepUtils.isSweepAligned(n, e.fromSweep),
												i = o.sweepUtils.isSweepAligned(n, e.toSweep)
											return (a[0] = o.viewmodeConverter.toSdk(t, s)), (a[1] = o.viewmodeConverter.toSdk(t, i)), a
										}
									o.subscribe(t.EndMoveToSweepMessage, t => {
										o.sweepUtils.isSweepAligned(n, t.fromSweep) !== o.sweepUtils.isSweepAligned(n, t.toSweep) &&
											e.broadcast(de.CHANGE_END, s, t)
									})
									const i = [void 0, void 0],
										d = e => {
											const t = o.sweepUtils.isCurrentSweepAligned(n)
											return (
												(i[0] = o.viewmodeConverter.toSdk(e.fromMode, t)),
												(i[1] = o.viewmodeConverter.toSdk(e.toMode, t)),
												i
											)
										}
									o.subscribe(t.BeginSwitchViewmodeMessage, t => e.broadcast(de.CHANGE_START, d, t))
									const c = [void 0, void 0],
										u = e => {
											const t = o.sweepUtils.isCurrentSweepAligned(n)
											return (
												(c[0] = o.viewmodeConverter.toSdk(e.fromMode, t)),
												(c[1] = o.viewmodeConverter.toSdk(e.toMode, t)),
												c
											)
										}
									o.subscribe(t.EndSwitchViewmodeMessage, t => e.broadcast(de.CHANGE_END, u, t))
								})
						})(o, c, qe, new DependencyFetcher(W, ee)),
						(function (e, t, o, n, a) {
							n.addBinding(MoveToModeCommand, async e => {
								try {
									e.options = e.options || {}
									let t = o.CameraTransitionType.Interpolate
									const r = e.options.transition
									return (
										void 0 === r || isNaN(r) || (t = r),
										await n.issueCommand(
											new o.ChangeViewmodeCommand(e.mode, t, {
												position: e.options.position,
												rotation: e.options.rotation,
												zoom: e.options.zoom
											})
										),
										e.mode
									)
								} catch (t) {
									const o =
										t instanceof ViewmodeActiveTransitionError
											? `Mode.moveTo -> Cannot move to ${e.mode} during a mode transition`
											: `Mode.moveTo -> Could not move to ${e.mode}`
									if ((ce.error(t, o), t instanceof ViewmodeActiveTransitionError))
										throw Error(`Mode.moveTo -> Cannot move to ${e.mode} during a mode transition`)
									throw Error(`Mode.moveTo -> Could not move to ${e.mode}`)
								}
							})
							const s = new MoveToModeValidation(t, o.CommandViewmode, n.conversionUtils, n.cameraTransitionConverter)
							e.addCommandCreator(
								{ namespace: "Mode", name: "moveTo", args: ["mode", "options"] },
								e => new MoveToModeCommand(s.validateMoveToModeInput(e))
							),
								e.addEnumToInterface({ namespace: "Mode", name: "Mode", values: o.CommandViewmode }),
								e.addEnumToInterface({ namespace: "Mode", name: "TransitionType", values: r })
						})(o, g, c, qe, new DependencyFetcher()),
						ue(o, qe, new DependencyFetcher(M, W, I, Ue)),
						pe(o, c, qe, new DependencyFetcher(M, j)),
						(function (e, t, o, n) {
							e.addEnumToInterface({ namespace: "Model", name: "Event", values: me })
							const r = { sid: "", sweeps: [], modelSupportsVr: !1 },
								a = [r]
							n.getDependencies().then(n => {
								o.subscribe(t.ModelDataLoadedMessage, async t => {
									const [s, i, d] = n
									await o.makeModelData(t.sid, t.vrSupported, s.getSweepList(), i, d, r),
										e.broadcast(me.MODEL_LOADED, () => a)
								})
							})
						})(o, c, qe, new DependencyFetcher(W, I, Ue)),
						(function (e, t, o, n) {
							const r = SdkObservable.create(n, new PointerSubFactory(), new ClassFactory(ObservablePointer, t, o))
							e.addEnumToInterface({ namespace: "Pointer", name: "Colliders", values: he }),
								e.addObservableToInterface({ namespace: "Pointer", name: "intersection" }, r)
						})(o, g, c, new DependencyFetcher(B, I, H, N)),
						(function (e, t, o, n, r) {
							const a = new ScreenCapturer(new t.Camera(), n.encodeRenderTarget),
								s = new ClassFactory(ScreenshotExecutor, a, o, n),
								i = SdkCommand.create(r, s),
								d = SdkCommand.create(
									r,
									new ClassFactory(
										DeprecatedDecorator,
										s,
										"Camera.takeScreenshot deprecated, please use Renderer.takeScreenshot"
									)
								)
							e.addCommandToInterface(
								{ namespace: "Renderer", name: "takeScreenShot", args: ["resolution", "visibleObjects", "returnType"] },
								i
							),
								e.addCommandToInterface(
									{ namespace: "Camera", name: "takeScreenShot", args: ["resolution", "visibleObjects", "returnType"] },
									d
								)
						})(o, g, c, qe, new DependencyFetcher(T, Me, Te)),
						(function (e, t, o, n, r) {
							const a = SdkCommand.create(r, new ClassFactory(EquirectangularExecutor, t, o, n))
							e.addCommandToInterface({ namespace: "Renderer", name: "takeEquirectangular", args: [] }, a)
						})(o, g, c, qe, new DependencyFetcher(Me, Te, ee, W, Pe)),
						(function (e, t, o, n) {
							const r = SdkCommand.create(n, new ClassFactory(WorldToScreen, t, o))
							e.addCommandToInterface({ namespace: "Renderer", name: "getScreenPosition", args: ["worldPosition"] }, r)
						})(o, c, qe, new DependencyFetcher(Me)),
						(function (e, t, o, n) {
							const r = SdkCommand.create(n, new ClassFactory(WorldPositionExecutor, t, o))
							e.addCommandToInterface(
								{
									namespace: "Renderer",
									name: "getWorldPositionData",
									args: ["screenPosition", "height", "includeHiddenFloors"]
								},
								r
							)
						})(o, c, qe, new DependencyFetcher(I, ne)),
						(function (e, t) {
							const o = SdkObservable.create(t, new CurrentRoomSubFactory(), new ClassFactory(CurrentRoomObservable))
							e.addObservableToInterface({ namespace: "Room", name: "current", objectFactory: "current.room" }, o)
						})(o, new DependencyFetcher(H, S, W, I, ee, N, Be)),
						(function (e, t) {
							const o = SdkCollection.create(t, new RoomSubFactory(), new ClassFactory(RoomCollectionData))
							e.addCollectionToInterface({ namespace: "Room", name: "data", elementFactory: "collection.room" }, o)
						})(o, new DependencyFetcher(H, I, Be, N)),
						(function (e) {
							e.addEnumToInterface({ namespace: "Scene", name: "InteractionType", values: fe }),
								e.addEnumToInterface({ namespace: "Scene", name: "Component", values: Ce }),
								e.addEnumToInterface({ namespace: "Scene", name: "PathType", values: we })
						})(o),
						(function (e, t, o) {
							t.addBinding(RegisterCommand, async e => {
								const [t] = await o.getDependencies()
								return t.registerFactory(e.name, e.factory)
							}),
								e.addCommandCreator(
									{ namespace: "Scene", name: "register", args: ["name", "factory"] },
									e => new RegisterCommand(e)
								),
								o.getDependencies().then(([t]) => {
									e.addEnumToInterface({ namespace: "Scene", name: "Component", values: t.componentMap() })
								})
						})(o, qe, new DependencyFetcher(Ie)),
						(function (e, t, o) {
							t.addBinding(CreateNodeCommand, async () => {
								const [e] = await o.getDependencies()
								return e.createNode()
							}),
								e.addCommandCreator(
									{ namespace: "Scene", name: "createNode", args: ["userContext"] },
									e => new CreateNodeCommand(e)
								)
						})(o, qe, new DependencyFetcher(Ie)),
						(function (e, t, o) {
							t.addBinding(QueryCommand, async e => {
								const [t] = await o.getDependencies()
								return t.sceneTags().getObjects(e.tags)
							}),
								e.addCommandCreator({ namespace: "Scene", name: "query", args: ["tags"] }, e => new QueryCommand(e))
						})(o, qe, new DependencyFetcher(Ie, ye)),
						(function (e, t, o, n) {
							n.getDependencies().then(([e]) => {
								o.addBinding(ConfigureCommand, async o => {
									o.callback(e.cwfRenderer.renderer, t, e.getScene().effectComposer)
								})
							}),
								e.addCommandCreator(
									{ namespace: "Scene", name: "configure", args: ["callback"] },
									e => new ConfigureCommand(e)
								)
						})(o, g, qe, new DependencyFetcher(Me)),
						(function (e, t, o) {
							o.getDependencies().then(([e]) => {
								t.addBinding(GetImageCommand, async t =>
									e.getSignedUrls().getImageBitmap(t.path, t.width, t.height, t.options)
								)
							}),
								e.addCommandCreator(
									{ namespace: "Scene", name: "getImage", args: ["path", "width", "height", "options"] },
									e => new GetImageCommand(e)
								)
						})(o, qe, new DependencyFetcher(ge)),
						(function (e, t, o) {
							t.addBinding(DeserializeCommand, async e => {
								const [t] = await o.getDependencies()
								return t.deserialize(e.text)
							}),
								e.addCommandCreator(
									{ namespace: "Scene", name: "deserialize", args: ["text"] },
									e => new DeserializeCommand(e)
								)
						})(o, qe, new DependencyFetcher(Ie)),
						(function (e, t, o) {
							t.addBinding(SerializeCommand, async e => {
								const [t] = await o.getDependencies()
								return t.serialize(e.objects)
							}),
								e.addCommandCreator(
									{ namespace: "Scene", name: "serialize", args: ["objects"] },
									e => new SerializeCommand(e)
								)
						})(o, qe, new DependencyFetcher(Ie)),
						(function (e, t, o) {
							t.addBinding(CreateNodesCommand, async e => {
								if (!q(e.count)) throw Error("count is not a valid number")
								const [t] = await o.getDependencies(),
									n = []
								for (let o = 0; o < e.count; o++) n.push(t.createNode())
								return n
							}),
								e.addCommandCreator(
									{ namespace: "Scene", name: "createNodes", args: ["count", "userContext"] },
									e => new CreateNodesCommand(e)
								)
						})(o, qe, new DependencyFetcher(Ie)),
						(function (e, t, o) {
							t.addBinding(RegisterComponentsCommand, async e => {
								const [t] = await o.getDependencies()
								if (!Array.isArray(e.components)) throw Error("components must be an array")
								for (const o of e.components) t.registerFactory(o.name, o.factory)
							}),
								e.addCommandCreator(
									{ namespace: "Scene", name: "registerComponents", args: ["components"] },
									e => new RegisterComponentsCommand(e)
								)
						})(o, qe, new DependencyFetcher(Ie)),
						(function (e, t, o) {
							t.addBinding(CreateObjectsCommand, async e => {
								if (!q(e.count)) throw Error("count is not a valid number")
								const [t] = await o.getDependencies(),
									n = []
								for (let o = 0; o < e.count; o++) n.push(t.createObject())
								return n
							}),
								e.addCommandCreator(
									{ namespace: "Scene", name: "createObjects", args: ["count"] },
									e => new CreateObjectsCommand(e)
								)
						})(o, qe, new DependencyFetcher(Ie)),
						De(g, c.SourceType, c.sensorVolumes)(o, new DependencyFetcher(Ee)),
						(function (e, t, o, n) {
							o.addBinding(t.SettingGetCommand, async e => {
								const [t] = await n.getDependencies()
								return t.tryGetProperty(e.key, void 0)
							}),
								e.addCommandCreator(
									{ namespace: "Settings", name: "get", args: ["key"] },
									e => new t.SettingGetCommand(e.key)
								)
						})(o, c, qe, new DependencyFetcher(ve)),
						(function (e, t, o, n) {
							o.addBinding(t.SettingUpdateCommand, async e => {
								if (!e.key || "string" != typeof e.key) throw Error("Settings: invalid key")
								const [t] = await n.getDependencies()
								return t.updateSetting(e.key, e.value), t.tryGetProperty(e.key, void 0)
							}),
								e.addCommandCreator(
									{ namespace: "Settings", name: "update", args: ["key", "value"] },
									e => new t.SettingUpdateCommand(e.key, e.value)
								)
						})(o, c, qe, new DependencyFetcher(ve)),
						(function (e, t, o) {
							o.getDependencies().then(([o]) => {
								new FpsCalculator(t.waitForUpdate, o).calcAndBroadcast(e)
							}),
								e.addEnumToInterface({ namespace: "Stat", name: "Event", values: Oe })
						})(o, qe, new DependencyFetcher(j)),
						(function (e) {
							e.addEnumToInterface({ namespace: "Sweep", name: "Transition", values: r }),
								e.addEnumToInterface({ namespace: "Sweep", name: "Alignment", values: Ae }),
								e.addEnumToInterface({ namespace: "Sweep", name: "Placement", values: Ne })
						})(o),
						(function (e, t, o, n) {
							const r = SdkObservable.create(
								n,
								new CurrentSweepSubFactory(),
								new ClassFactory(CurrentSweepObservable, t, o)
							)
							e.addObservableToInterface({ namespace: "Sweep", name: "current" }, r)
						})(o, c, qe, new DependencyFetcher(W, ee, I, Ue, ze)),
						(function (e, t, o, n) {
							e.addEnumToInterface({ namespace: "Sweep", name: "Event", values: xe })
							const r = ["", ""],
								a = () => r
							o.subscribe(t.BeginMoveToSweepMessage, async t => {
								const o = await n
								t.fromSweep &&
									t.fromSweep !== t.toSweep &&
									((r[0] = t.fromSweep ? o.getIdFromCwfId(t.fromSweep) : t.fromSweep),
									(r[1] = o.getIdFromCwfId(t.toSweep)),
									e.broadcast(xe.EXIT, a, t))
							}),
								o.subscribe(t.BeginSwitchViewmodeMessage, o => {
									o.fromMode === t.Viewmode.Panorama &&
										o.toMode !== t.Viewmode.Panorama &&
										((r[0] = s[1]), (r[1] = void 0), e.broadcast(xe.EXIT, a))
								})
							const s = ["", ""],
								i = () => s
							o.subscribe(t.EndMoveToSweepMessage, async t => {
								const o = await n
								;(s[0] = t.fromSweep ? o.getIdFromCwfId(t.fromSweep) : t.fromSweep),
									(s[1] = o.getIdFromCwfId(t.toSweep)),
									e.broadcast(xe.ENTER, i)
							})
						})(o, c, qe, Ue),
						(function (e, t, o, n) {
							const a = SdkCommand.create(n, new ClassFactory(MoveToSweepExecutor, t, o))
							e.addEnumToInterface({ namespace: "Sweep", name: "Transition", values: r }),
								e.addCommandToInterface({ namespace: "Sweep", name: "moveTo", args: ["sweep", "options"] }, a)
						})(o, c, qe, new DependencyFetcher(W, Ue)),
						(function (e, t, o) {
							const n = SdkCollection.create(
								o,
								new SweepSubFactory(),
								new ClassFactory(SweepDataCollection, t.conversionUtils, t.sweepPlacementConverter)
							)
							e.addCollectionToInterface({ namespace: "Sweep", name: "data" }, n)
						})(o, qe, new DependencyFetcher(W, I, Ue, ze)),
						(function (e, t) {
							const o = SdkCommand.create(t, new ClassFactory(EnableExecutor)),
								n = SdkCommand.create(t, new ClassFactory(DisableExecutor))
							e.addCommandToInterface({ namespace: "Sweep", name: "enable", args: ["sweepIds"], varArg: !0 }, o),
								e.addCommandToInterface({ namespace: "Sweep", name: "disable", args: ["sweepIds"], varArg: !0 }, n)
						})(o, new DependencyFetcher(W, K, Ue)),
						(function (e, t, o) {
							e.addEnumToInterface({ namespace: "Tour", name: "Event", values: Fe }),
								o.subscribe(t.TourStartedMessage, () => e.broadcast(Fe.STARTED)),
								o.subscribe(t.TourStoppedMessage, () => e.broadcast(Fe.STOPPED)),
								o.subscribe(t.TourEndedMessage, () => e.broadcast(Fe.ENDED))
							const n = [-1],
								r = e => ((n[0] = e.index), n)
							o.subscribe(t.TourSteppedMessage, t => e.broadcast(Fe.STEPPED, r, t))
						})(o, c, qe),
						ke(o, c, qe, new DependencyFetcher(be, J))
				}
			})(),
			n
		)
	})()
})
